mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
ox: Add /ox log command
This commit is contained in:
parent
66eeccf408
commit
d011d6707c
@ -893,6 +893,11 @@ cmd_ac_init(void)
|
|||||||
autocomplete_add(ox_ac, "announce");
|
autocomplete_add(ox_ac, "announce");
|
||||||
autocomplete_add(ox_ac, "discover");
|
autocomplete_add(ox_ac, "discover");
|
||||||
autocomplete_add(ox_ac, "request");
|
autocomplete_add(ox_ac, "request");
|
||||||
|
|
||||||
|
ox_log_ac = autocomplete_new();
|
||||||
|
autocomplete_add(ox_log_ac, "on");
|
||||||
|
autocomplete_add(ox_log_ac, "off");
|
||||||
|
autocomplete_add(ox_log_ac, "redact");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tls_ac = autocomplete_new();
|
tls_ac = autocomplete_new();
|
||||||
@ -1443,6 +1448,7 @@ cmd_ac_reset(ProfWin* window)
|
|||||||
autocomplete_reset(pgp_log_ac);
|
autocomplete_reset(pgp_log_ac);
|
||||||
autocomplete_reset(pgp_sendfile_ac);
|
autocomplete_reset(pgp_sendfile_ac);
|
||||||
autocomplete_reset(ox_ac);
|
autocomplete_reset(ox_ac);
|
||||||
|
autocomplete_reset(ox_log_ac);
|
||||||
#endif
|
#endif
|
||||||
autocomplete_reset(tls_ac);
|
autocomplete_reset(tls_ac);
|
||||||
autocomplete_reset(titlebar_ac);
|
autocomplete_reset(titlebar_ac);
|
||||||
|
@ -1715,7 +1715,8 @@ static struct cmd_t command_defs[] = {
|
|||||||
#ifdef HAVE_LIBGPGME
|
#ifdef HAVE_LIBGPGME
|
||||||
{ "/ox",
|
{ "/ox",
|
||||||
parse_args, 1, 3, NULL,
|
parse_args, 1, 3, NULL,
|
||||||
CMD_NOSUBFUNCS
|
CMD_SUBFUNCS(
|
||||||
|
{ "log", cmd_ox_log })
|
||||||
CMD_MAINFUNC(cmd_ox)
|
CMD_MAINFUNC(cmd_ox)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
|
@ -7725,6 +7725,31 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_ox_log(ProfWin* window, const char* const command, gchar** args)
|
||||||
|
{
|
||||||
|
char* choice = args[1];
|
||||||
|
if (g_strcmp0(choice, "on") == 0) {
|
||||||
|
prefs_set_string(PREF_OX_LOG, "on");
|
||||||
|
cons_show("OX messages will be logged as plaintext.");
|
||||||
|
if (!prefs_get_boolean(PREF_CHLOG)) {
|
||||||
|
cons_show("Chat logging is currently disabled, use '/logging chat on' to enable.");
|
||||||
|
}
|
||||||
|
} else if (g_strcmp0(choice, "off") == 0) {
|
||||||
|
prefs_set_string(PREF_OX_LOG, "off");
|
||||||
|
cons_show("OX message logging disabled.");
|
||||||
|
} else if (g_strcmp0(choice, "redact") == 0) {
|
||||||
|
prefs_set_string(PREF_OX_LOG, "redact");
|
||||||
|
cons_show("OX messages will be logged as '[redacted]'.");
|
||||||
|
if (!prefs_get_boolean(PREF_CHLOG)) {
|
||||||
|
cons_show("Chat logging is currently disabled, use '/logging chat on' to enable.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cons_bad_cmd_usage(command);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
#endif // HAVE_LIBGPGME
|
#endif // HAVE_LIBGPGME
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -110,6 +110,7 @@ gboolean cmd_notify(ProfWin* window, const char* const command, gchar** args);
|
|||||||
gboolean cmd_pgp(ProfWin* window, const char* const command, gchar** args);
|
gboolean cmd_pgp(ProfWin* window, const char* const command, gchar** args);
|
||||||
#ifdef HAVE_LIBGPGME
|
#ifdef HAVE_LIBGPGME
|
||||||
gboolean cmd_ox(ProfWin* window, const char* const command, gchar** args);
|
gboolean cmd_ox(ProfWin* window, const char* const command, gchar** args);
|
||||||
|
gboolean cmd_ox_log(ProfWin* window, const char* const command, gchar** args);
|
||||||
#endif // HAVE_LIBGPGME
|
#endif // HAVE_LIBGPGME
|
||||||
gboolean cmd_outtype(ProfWin* window, const char* const command, gchar** args);
|
gboolean cmd_outtype(ProfWin* window, const char* const command, gchar** args);
|
||||||
gboolean cmd_prefs(ProfWin* window, const char* const command, gchar** args);
|
gboolean cmd_prefs(ProfWin* window, const char* const command, gchar** args);
|
||||||
|
@ -1882,6 +1882,8 @@ _get_group(preference_t pref)
|
|||||||
case PREF_OMEMO_POLICY:
|
case PREF_OMEMO_POLICY:
|
||||||
case PREF_OMEMO_TRUST_MODE:
|
case PREF_OMEMO_TRUST_MODE:
|
||||||
return PREF_GROUP_OMEMO;
|
return PREF_GROUP_OMEMO;
|
||||||
|
case PREF_OX_LOG:
|
||||||
|
return PREF_GROUP_OX;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -2153,6 +2155,8 @@ _get_key(preference_t pref)
|
|||||||
return "stamp.outgoing";
|
return "stamp.outgoing";
|
||||||
case PREF_INCOMING_STAMP:
|
case PREF_INCOMING_STAMP:
|
||||||
return "stamp.incoming";
|
return "stamp.incoming";
|
||||||
|
case PREF_OX_LOG:
|
||||||
|
return "log";
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -2297,6 +2301,8 @@ _get_default_string(preference_t pref)
|
|||||||
return NULL;
|
return NULL;
|
||||||
case PREF_URL_SAVE_CMD:
|
case PREF_URL_SAVE_CMD:
|
||||||
return NULL; // Default to built-in method.
|
return NULL; // Default to built-in method.
|
||||||
|
case PREF_OX_LOG:
|
||||||
|
return "redact";
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,7 @@ typedef enum {
|
|||||||
PREF_OUTGOING_STAMP,
|
PREF_OUTGOING_STAMP,
|
||||||
PREF_INCOMING_STAMP,
|
PREF_INCOMING_STAMP,
|
||||||
PREF_NOTIFY_ROOM_OFFLINE,
|
PREF_NOTIFY_ROOM_OFFLINE,
|
||||||
|
PREF_OX_LOG,
|
||||||
} preference_t;
|
} preference_t;
|
||||||
|
|
||||||
typedef struct prof_alias_t
|
typedef struct prof_alias_t
|
||||||
|
Loading…
Reference in New Issue
Block a user