1
0
Fork 0

Allow utf8 symbols as omemo/pgp/otr indicator char

Fix https://github.com/profanity-im/profanity/issues/1264
This commit is contained in:
Michael Vetter 2020-02-20 18:11:08 +01:00
parent 280b718cfb
commit 1f8b1eb740
21 changed files with 643 additions and 622 deletions

File diff suppressed because it is too large Load Diff

View File

@ -868,82 +868,79 @@ prefs_get_roster_size(void)
}
}
char
char*
prefs_get_otr_char(void)
{
char result = '~';
char *result = "~";
char *resultstr = g_key_file_get_string(prefs, PREF_GROUP_OTR, "otr.char", NULL);
if (!resultstr) {
result = '~';
result = strdup("~");
} else {
result = resultstr[0];
result = resultstr;
}
free(resultstr);
return result;
}
void
prefs_set_otr_char(char ch)
prefs_set_otr_char(char *ch)
{
char str[2];
str[0] = ch;
str[1] = '\0';
g_key_file_set_string(prefs, PREF_GROUP_OTR, "otr.char", str);
if (g_utf8_strlen(ch, 4) == 1) {
g_key_file_set_string(prefs, PREF_GROUP_OTR, "otr.char", ch);
} else {
log_error("Could not set otr char: %s", ch);
}
}
char
char*
prefs_get_pgp_char(void)
{
char result = '~';
char *result = "~";
char *resultstr = g_key_file_get_string(prefs, PREF_GROUP_PGP, "pgp.char", NULL);
if (!resultstr) {
result = '~';
result = strdup("~");
} else {
result = resultstr[0];
result = resultstr;
}
free(resultstr);
return result;
}
void
prefs_set_pgp_char(char ch)
prefs_set_pgp_char(char *ch)
{
char str[2];
str[0] = ch;
str[1] = '\0';
g_key_file_set_string(prefs, PREF_GROUP_PGP, "pgp.char", str);
if (g_utf8_strlen(ch, 4) == 1) {
g_key_file_set_string(prefs, PREF_GROUP_PGP, "pgp.char", ch);
} else {
log_error("Could not set pgp char: %s", ch);
}
}
char
char*
prefs_get_omemo_char(void)
{
char result = '~';
char *result = "~";
char *resultstr = g_key_file_get_string(prefs, PREF_GROUP_OMEMO, "omemo.char", NULL);
if (!resultstr) {
result = '~';
result = strdup("~");
} else {
result = resultstr[0];
result = resultstr;
}
free(resultstr);
return result;
}
void
prefs_set_omemo_char(char ch)
prefs_set_omemo_char(char *ch)
{
char str[2];
str[0] = ch;
str[1] = '\0';
g_key_file_set_string(prefs, PREF_GROUP_OMEMO, "omemo.char", str);
if (g_utf8_strlen(ch, 4) == 1) {
g_key_file_set_string(prefs, PREF_GROUP_OMEMO, "omemo.char", ch);
} else {
log_error("Could not set omemo char: %s", ch);
}
}
char
@ -1201,18 +1198,17 @@ prefs_set_roster_presence_indent(gint value)
g_key_file_set_integer(prefs, PREF_GROUP_UI, "roster.presence.indent", value);
}
char
char*
prefs_get_correction_char(void)
{
char result = '+';
char *result = "+";
char *resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "correction.char", NULL);
if (!resultstr) {
result = '+';
result = strdup("+");
} else {
result = resultstr[0];
result = resultstr;
}
free(resultstr);
return result;
}

View File

@ -232,12 +232,12 @@ void prefs_free_plugins(gchar **plugins);
void prefs_add_plugin(const char *const name);
void prefs_remove_plugin(const char *const name);
char prefs_get_otr_char(void);
void prefs_set_otr_char(char ch);
char prefs_get_pgp_char(void);
void prefs_set_pgp_char(char ch);
char prefs_get_omemo_char(void);
void prefs_set_omemo_char(char ch);
char* prefs_get_otr_char(void);
void prefs_set_otr_char(char *ch);
char* prefs_get_pgp_char(void);
void prefs_set_pgp_char(char *ch);
char* prefs_get_omemo_char(void);
void prefs_set_omemo_char(char *ch);
char prefs_get_roster_header_char(void);
void prefs_set_roster_header_char(char ch);
@ -273,7 +273,7 @@ void prefs_set_roster_presence_indent(gint value);
gint prefs_get_occupants_indent(void);
void prefs_set_occupants_indent(gint value);
char prefs_get_correction_char(void);
char* prefs_get_correction_char(void);
void prefs_set_correction_char(char ch);
void prefs_add_login(const char *jid);

View File

@ -461,24 +461,24 @@ _load_preferences(void)
if (g_key_file_has_key(theme, "ui", "otr.char", NULL)) {
gchar *ch = g_key_file_get_string(theme, "ui", "otr.char", NULL);
if (ch && strlen(ch) > 0) {
prefs_set_otr_char(ch[0]);
if (ch && g_utf8_strlen(ch, 4) == 1) {
prefs_set_otr_char(ch);
g_free(ch);
}
}
if (g_key_file_has_key(theme, "ui", "pgp.char", NULL)) {
gchar *ch = g_key_file_get_string(theme, "ui", "pgp.char", NULL);
if (ch && strlen(ch) > 0) {
prefs_set_pgp_char(ch[0]);
if (ch && g_utf8_strlen(ch, 4) == 1) {
prefs_set_pgp_char(ch);
g_free(ch);
}
}
if (g_key_file_has_key(theme, "ui", "omemo.char", NULL)) {
gchar *ch = g_key_file_get_string(theme, "ui", "omemo.char", NULL);
if (ch && strlen(ch) > 0) {
prefs_set_omemo_char(ch[0]);
if (ch && g_utf8_strlen(ch, 4) == 1) {
prefs_set_omemo_char(ch);
g_free(ch);
}
}

View File

@ -676,7 +676,7 @@ sv_ev_incoming_message(ProfMessage *message)
#ifdef HAVE_OMEMO
if (message->encrypted) {
if (chatwin->is_otr) {
win_println((ProfWin*)chatwin, THEME_DEFAULT, '-', "PGP encrypted message received whilst in OTR session.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, "-", "PGP encrypted message received whilst in OTR session.");
} else {
_sv_ev_incoming_pgp(chatwin, new_win, message, TRUE);
}

View File

@ -353,14 +353,14 @@ otr_on_message_send(ProfChatWin *chatwin, const char *const message, gboolean re
free(id);
return TRUE;
} else {
win_println((ProfWin*)chatwin, THEME_ERROR, '-', "%s", "Failed to encrypt and send message.");
win_println((ProfWin*)chatwin, THEME_ERROR, "-", "%s", "Failed to encrypt and send message.");
return TRUE;
}
}
// show error if not secure and policy always
if (policy == PROF_OTRPOLICY_ALWAYS) {
win_println((ProfWin*)chatwin, THEME_ERROR, '-', "%s", "Failed to send message. OTR policy set to: always");
win_println((ProfWin*)chatwin, THEME_ERROR, "-", "%s", "Failed to send message. OTR policy set to: always");
return TRUE;
}

View File

@ -86,7 +86,7 @@ api_cons_show_themed(const char *const group, const char *const key, const char
char *parsed = str_replace(message, "\r\n", "\n");
theme_item_t themeitem = plugin_themes_get(group, key, def);
ProfWin *console = wins_get_console();
win_println(console, themeitem, '-', "%s", parsed);
win_println(console, themeitem, "-", "%s", parsed);
free(parsed);
@ -375,7 +375,7 @@ api_win_show(const char *tag, const char *line)
}
ProfWin *window = (ProfWin*)pluginwin;
win_println(window, THEME_DEFAULT, '!', "%s", line);
win_println(window, THEME_DEFAULT, "!", "%s", line);
return 1;
}
@ -400,7 +400,7 @@ api_win_show_themed(const char *tag, const char *const group, const char *const
theme_item_t themeitem = plugin_themes_get(group, key, def);
ProfWin *window = (ProfWin*)pluginwin;
win_println(window, themeitem, '!', "%s", line);
win_println(window, themeitem, "!", "%s", line);
return 1;
}
@ -522,7 +522,7 @@ api_encryption_reset(const char *const barejid)
#ifdef HAVE_LIBGPGME
if (chatwin->pgp_send) {
chatwin->pgp_send = FALSE;
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "PGP encryption disabled.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", "PGP encryption disabled.");
}
#endif
@ -784,7 +784,7 @@ api_chat_show(const char *const barejid, const char *message)
}
char *parsed = str_replace(message, "\r\n", "\n");
win_println((ProfWin*)chatwin, THEME_TEXT, '-', "%s", parsed);
win_println((ProfWin*)chatwin, THEME_TEXT, "-", "%s", parsed);
free(parsed);
return 1;
@ -804,13 +804,13 @@ api_chat_show_themed(const char *const barejid, const char *const group, const c
return 0;
}
char show_ch = '-';
char *show_ch = "-";
if (ch) {
if (strlen(ch) != 1) {
if (g_utf8_strlen(ch, 4) != 1) {
log_warning("%s", "api_chat_show_themed failed, ch must be a string of length 1");
return 0;
} else {
show_ch = ch[0];
show_ch = (char*)ch;
}
}
@ -849,7 +849,7 @@ api_room_show(const char *const roomjid, const char *message)
}
char *parsed = str_replace(message, "\r\n", "\n");
win_println((ProfWin*)mucwin, THEME_TEXT, '-', "%s", parsed);
win_println((ProfWin*)mucwin, THEME_TEXT, "-", "%s", parsed);
free(parsed);
return 1;
@ -869,13 +869,13 @@ api_room_show_themed(const char *const roomjid, const char *const group, const c
return 0;
}
char show_ch = '-';
char *show_ch = "-";
if (ch) {
if (strlen(ch) != 1) {
if (g_utf8_strlen(ch, 4) != 1) {
log_warning("%s", "api_room_show_themed failed, ch must be a string of length 1");
return 0;
} else {
show_ch = ch[0];
show_ch = (char*)ch;
}
}

View File

@ -81,11 +81,11 @@ buffer_free(ProfBuff buffer)
}
void
buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *time,
buffer_append(ProfBuff buffer, const char *show_char, int pad_indent, GDateTime *time,
int flags, theme_item_t theme_item, const char *const display_from, const char *const message, DeliveryReceipt *receipt, const char *const id)
{
ProfBuffEntry *e = malloc(sizeof(struct prof_buff_entry_t));
e->show_char = show_char;
e->show_char = strdup(show_char);
e->pad_indent = pad_indent;
e->flags = flags;
e->theme_item = theme_item;
@ -163,6 +163,7 @@ buffer_get_entry_by_id(ProfBuff buffer, const char *const id)
static void
_free_entry(ProfBuffEntry *entry)
{
free(entry->show_char);
free(entry->message);
free(entry->display_from);
free(entry->id);

View File

@ -47,7 +47,8 @@ typedef struct delivery_receipt_t {
} DeliveryReceipt;
typedef struct prof_buff_entry_t {
char show_char;
// pointer because it could be a unicode symbol as well
char *show_char;
int pad_indent;
GDateTime *time;
int flags;
@ -65,7 +66,7 @@ typedef struct prof_buff_t *ProfBuff;
ProfBuff buffer_create();
void buffer_free(ProfBuff buffer);
void buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *time,
void buffer_append(ProfBuff buffer, const char *show_char, int pad_indent, GDateTime *time,
int flags, theme_item_t theme_item, const char *const display_from, const char *const message, DeliveryReceipt *receipt, const char *const id);
void buffer_remove_entry_by_id(ProfBuff buffer, const char *const id);
int buffer_size(ProfBuff buffer);

View File

@ -109,9 +109,9 @@ chatwin_otr_secured(ProfChatWin *chatwin, gboolean trusted)
ProfWin *window = (ProfWin*) chatwin;
if (trusted) {
win_println(window, THEME_OTR_STARTED_TRUSTED, '!', "OTR session started (trusted).");
win_println(window, THEME_OTR_STARTED_TRUSTED, "!", "OTR session started (trusted).");
} else {
win_println(window, THEME_OTR_STARTED_UNTRUSTED, '!', "OTR session started (untrusted).");
win_println(window, THEME_OTR_STARTED_UNTRUSTED, "!", "OTR session started (untrusted).");
}
if (wins_is_current(window)) {
@ -138,7 +138,7 @@ chatwin_otr_unsecured(ProfChatWin *chatwin)
chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin;
win_println(window, THEME_OTR_ENDED, '!', "OTR session ended.");
win_println(window, THEME_OTR_ENDED, "!", "OTR session ended.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -151,41 +151,41 @@ chatwin_otr_smp_event(ProfChatWin *chatwin, prof_otr_smp_event_t event, void *da
switch (event) {
case PROF_OTR_SMP_INIT:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!',
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!",
"%s wants to authenticate your identity, use '/otr secret <secret>'.", chatwin->barejid);
break;
case PROF_OTR_SMP_INIT_Q:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!',
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!",
"%s wants to authenticate your identity with the following question:", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', " %s", (char*)data);
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "use '/otr answer <answer>'.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", " %s", (char*)data);
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", "use '/otr answer <answer>'.");
break;
case PROF_OTR_SMP_SENDER_FAIL:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!',
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!",
"Authentication failed, the secret you entered does not match the secret entered by %s.",
chatwin->barejid);
break;
case PROF_OTR_SMP_RECEIVER_FAIL:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!',
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!",
"Authentication failed, the secret entered by %s does not match yours.", chatwin->barejid);
break;
case PROF_OTR_SMP_ABORT:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "SMP session aborted.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", "SMP session aborted.");
break;
case PROF_OTR_SMP_SUCCESS:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "Authentication successful.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", "Authentication successful.");
break;
case PROF_OTR_SMP_SUCCESS_Q:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "%s successfully authenticated you.", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", "%s successfully authenticated you.", chatwin->barejid);
break;
case PROF_OTR_SMP_FAIL_Q:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "%s failed to authenticate you.", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", "%s failed to authenticate you.", chatwin->barejid);
break;
case PROF_OTR_SMP_AUTH:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "Authenticating %s...", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", "Authenticating %s...", chatwin->barejid);
break;
case PROF_OTR_SMP_AUTH_WAIT:
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "Awaiting authentication from %s...", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, "!", "Awaiting authentication from %s...", chatwin->barejid);
break;
default:
break;
@ -201,7 +201,7 @@ chatwin_otr_trust(ProfChatWin *chatwin)
chatwin->otr_is_trusted = TRUE;
ProfWin *window = (ProfWin*)chatwin;
win_println(window, THEME_OTR_TRUSTED, '!', "OTR session trusted.");
win_println(window, THEME_OTR_TRUSTED, "!", "OTR session trusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -216,7 +216,7 @@ chatwin_otr_untrust(ProfChatWin *chatwin)
chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin;
win_println(window, THEME_OTR_UNTRUSTED, '!', "OTR session untrusted.");
win_println(window, THEME_OTR_UNTRUSTED, "!", "OTR session untrusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -240,7 +240,7 @@ chatwin_recipient_gone(ProfChatWin *chatwin)
display_usr = chatwin->barejid;
}
win_println((ProfWin*)chatwin, THEME_GONE, '!', "<- %s has left the conversation.", display_usr);
win_println((ProfWin*)chatwin, THEME_GONE, "!", "<- %s has left the conversation.", display_usr);
}
void
@ -314,15 +314,17 @@ chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id,
{
assert(chatwin != NULL);
char enc_char = '-';
char *enc_char;
if (chatwin->outgoing_char) {
enc_char = chatwin->outgoing_char[0];
enc_char = chatwin->outgoing_char;
} else if (enc_mode == PROF_MSG_ENC_OTR) {
enc_char = prefs_get_otr_char();
} else if (enc_mode == PROF_MSG_ENC_PGP) {
enc_char = prefs_get_pgp_char();
} else if (enc_mode == PROF_MSG_ENC_OMEMO) {
enc_char = prefs_get_omemo_char();
} else {
enc_char = strdup("-");
}
if (request_receipt && id) {
@ -331,6 +333,8 @@ chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id,
win_print_outgoing((ProfWin*)chatwin, enc_char, id, replace_id, message);
}
free(enc_char);
// save last id and message for LMC
if (id) {
_chatwin_set_last_message(chatwin, id, message);
@ -342,11 +346,13 @@ chatwin_outgoing_carbon(ProfChatWin *chatwin, ProfMessage *message)
{
assert(chatwin != NULL);
char enc_char = '-';
char *enc_char;
if (message->enc == PROF_MSG_ENC_PGP) {
enc_char = prefs_get_pgp_char();
} else if (message->enc == PROF_MSG_ENC_OMEMO) {
enc_char = prefs_get_omemo_char();
} else {
enc_char = strdup("-");
}
ProfWin *window = (ProfWin*)chatwin;
@ -354,6 +360,8 @@ chatwin_outgoing_carbon(ProfChatWin *chatwin, ProfMessage *message)
win_print_outgoing(window, enc_char, message->id, message->replace_id, message->plain);
int num = wins_get_num(window);
status_bar_active(num, WIN_CHAT, chatwin->barejid);
free(enc_char);
}
void

View File

@ -48,12 +48,12 @@ confwin_show_form(ProfConfWin *confwin)
{
ProfWin *window = (ProfWin*) confwin;
if (confwin->form->title) {
win_print(window, THEME_DEFAULT, '-', "Form title: ");
win_print(window, THEME_DEFAULT, "-", "Form title: ");
win_appendln(window, THEME_DEFAULT, "%s", confwin->form->title);
} else {
win_println(window, THEME_DEFAULT, '-', "Configuration for room %s.", confwin->roomjid);
win_println(window, THEME_DEFAULT, "-", "Configuration for room %s.", confwin->roomjid);
}
win_println(window, THEME_DEFAULT, '-', "");
win_println(window, THEME_DEFAULT, "-", "");
confwin_form_help(confwin);
@ -65,7 +65,7 @@ confwin_show_form(ProfConfWin *confwin)
if ((g_strcmp0(field->type, "fixed") == 0) && field->values) {
if (field->values) {
char *value = field->values->data;
win_println(window, THEME_DEFAULT, '-', "%s", value);
win_println(window, THEME_DEFAULT, "-", "%s", value);
}
} else if (g_strcmp0(field->type, "hidden") != 0 && field->var) {
char *tag = g_hash_table_lookup(confwin->form->var_to_tag, field->var);
@ -84,7 +84,7 @@ confwin_show_form_field(ProfConfWin *confwin, DataForm *form, char *tag)
FormField *field = form_get_field_by_tag(form, tag);
ProfWin *window = (ProfWin*)confwin;
_confwin_form_field(window, tag, field);
win_println(window, THEME_DEFAULT, '-', "");
win_println(window, THEME_DEFAULT, "-", "");
}
void
@ -97,13 +97,13 @@ confwin_handle_configuration(ProfConfWin *confwin, DataForm *form)
confwin_show_form(confwin);
win_println(window, THEME_DEFAULT, '-', "");
win_println(window, THEME_DEFAULT, "-", "");
if (confwin->submit != NULL) {
win_println(window, THEME_DEFAULT, '-', "Use '/form submit' to save changes.");
win_println(window, THEME_DEFAULT, "-", "Use '/form submit' to save changes.");
}
win_println(window, THEME_DEFAULT, '-', "Use '/form cancel' to cancel changes.");
win_println(window, THEME_DEFAULT, '-', "See '/form help' for more information.");
win_println(window, THEME_DEFAULT, '-', "");
win_println(window, THEME_DEFAULT, "-", "Use '/form cancel' to cancel changes.");
win_println(window, THEME_DEFAULT, "-", "See '/form help' for more information.");
win_println(window, THEME_DEFAULT, "-", "");
}
void
@ -114,16 +114,16 @@ confwin_field_help(ProfConfWin *confwin, char *tag)
ProfWin *window = (ProfWin*) confwin;
FormField *field = form_get_field_by_tag(confwin->form, tag);
if (field) {
win_print(window, THEME_DEFAULT, '-', "%s", field->label);
win_print(window, THEME_DEFAULT, "-", "%s", field->label);
if (field->required) {
win_appendln(window, THEME_DEFAULT, " (Required):");
} else {
win_appendln(window, THEME_DEFAULT, ":");
}
if (field->description) {
win_println(window, THEME_DEFAULT, '-', " Description : %s", field->description);
win_println(window, THEME_DEFAULT, "-", " Description : %s", field->description);
}
win_println(window, THEME_DEFAULT, '-', " Type : %s", field->type);
win_println(window, THEME_DEFAULT, "-", " Type : %s", field->type);
int num_values = 0;
GSList *curr_option = NULL;
@ -132,51 +132,51 @@ confwin_field_help(ProfConfWin *confwin, char *tag)
switch (field->type_t) {
case FIELD_TEXT_SINGLE:
case FIELD_TEXT_PRIVATE:
win_println(window, THEME_DEFAULT, '-', " Set : /%s <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Where : <value> is any text");
win_println(window, THEME_DEFAULT, "-", " Set : /%s <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Where : <value> is any text");
break;
case FIELD_TEXT_MULTI:
num_values = form_get_value_count(confwin->form, tag);
win_println(window, THEME_DEFAULT, '-', " Add : /%s add <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Where : <value> is any text");
win_println(window, THEME_DEFAULT, "-", " Add : /%s add <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Where : <value> is any text");
if (num_values > 0) {
win_println(window, THEME_DEFAULT, '-', " Remove : /%s remove <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Where : <value> between 'val1' and 'val%d'", num_values);
win_println(window, THEME_DEFAULT, "-", " Remove : /%s remove <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Where : <value> between 'val1' and 'val%d'", num_values);
}
break;
case FIELD_BOOLEAN:
win_println(window, THEME_DEFAULT, '-', " Set : /%s <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Where : <value> is either 'on' or 'off'");
win_println(window, THEME_DEFAULT, "-", " Set : /%s <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Where : <value> is either 'on' or 'off'");
break;
case FIELD_LIST_SINGLE:
win_println(window, THEME_DEFAULT, '-', " Set : /%s <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Where : <value> is one of");
win_println(window, THEME_DEFAULT, "-", " Set : /%s <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Where : <value> is one of");
curr_option = field->options;
while (curr_option) {
option = curr_option->data;
win_println(window, THEME_DEFAULT, '-', " %s", option->value);
win_println(window, THEME_DEFAULT, "-", " %s", option->value);
curr_option = g_slist_next(curr_option);
}
break;
case FIELD_LIST_MULTI:
win_println(window, THEME_DEFAULT, '-', " Add : /%s add <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Remove : /%s remove <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Where : <value> is one of");
win_println(window, THEME_DEFAULT, "-", " Add : /%s add <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Remove : /%s remove <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Where : <value> is one of");
curr_option = field->options;
while (curr_option) {
option = curr_option->data;
win_println(window, THEME_DEFAULT, '-', " %s", option->value);
win_println(window, THEME_DEFAULT, "-", " %s", option->value);
curr_option = g_slist_next(curr_option);
}
break;
case FIELD_JID_SINGLE:
win_println(window, THEME_DEFAULT, '-', " Set : /%s <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Where : <value> is a valid Jabber ID");
win_println(window, THEME_DEFAULT, "-", " Set : /%s <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Where : <value> is a valid Jabber ID");
break;
case FIELD_JID_MULTI:
win_println(window, THEME_DEFAULT, '-', " Add : /%s add <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Remove : /%s remove <value>", tag);
win_println(window, THEME_DEFAULT, '-', " Where : <value> is a valid Jabber ID");
win_println(window, THEME_DEFAULT, "-", " Add : /%s add <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Remove : /%s remove <value>", tag);
win_println(window, THEME_DEFAULT, "-", " Where : <value> is a valid Jabber ID");
break;
case FIELD_FIXED:
case FIELD_UNKNOWN:
@ -185,7 +185,7 @@ confwin_field_help(ProfConfWin *confwin, char *tag)
break;
}
} else {
win_println(window, THEME_DEFAULT, '-', "No such field %s", tag);
win_println(window, THEME_DEFAULT, "-", "No such field %s", tag);
}
}
@ -196,16 +196,16 @@ confwin_form_help(ProfConfWin *confwin)
if (confwin->form->instructions) {
ProfWin *window = (ProfWin*) confwin;
win_println(window, THEME_DEFAULT, '-', "Supplied instructions:");
win_println(window, THEME_DEFAULT, '-', "%s", confwin->form->instructions);
win_println(window, THEME_DEFAULT, '-', "");
win_println(window, THEME_DEFAULT, "-", "Supplied instructions:");
win_println(window, THEME_DEFAULT, "-", "%s", confwin->form->instructions);
win_println(window, THEME_DEFAULT, "-", "");
}
}
static void
_confwin_form_field(ProfWin *window, char *tag, FormField *field)
{
win_print(window, THEME_AWAY, '-', "[%s] ", tag);
win_print(window, THEME_AWAY, "-", "[%s] ", tag);
win_append(window, THEME_DEFAULT, "%s", field->label);
if (field->required) {
win_append(window, THEME_DEFAULT, " (required): ");
@ -248,7 +248,7 @@ _confwin_form_field(ProfWin *window, char *tag, FormField *field)
char *value = curr_value->data;
GString *val_tag = g_string_new("");
g_string_printf(val_tag, "val%d", index++);
win_println(window, THEME_ONLINE, '-', " [%s] %s", val_tag->str, value);
win_println(window, THEME_ONLINE, "-", " [%s] %s", val_tag->str, value);
g_string_free(val_tag, TRUE);
curr_value = g_slist_next(curr_value);
}
@ -278,9 +278,9 @@ _confwin_form_field(ProfWin *window, char *tag, FormField *field)
while (curr_option) {
FormOption *option = curr_option->data;
if (g_strcmp0(option->value, value) == 0) {
win_println(window, THEME_ONLINE, '-', " [%s] %s", option->value, option->label);
win_println(window, THEME_ONLINE, "-", " [%s] %s", option->value, option->label);
} else {
win_println(window, THEME_OFFLINE, '-', " [%s] %s", option->value, option->label);
win_println(window, THEME_OFFLINE, "-", " [%s] %s", option->value, option->label);
}
curr_option = g_slist_next(curr_option);
}
@ -294,9 +294,9 @@ _confwin_form_field(ProfWin *window, char *tag, FormField *field)
while (curr_option) {
FormOption *option = curr_option->data;
if (g_slist_find_custom(curr_value, option->value, (GCompareFunc)g_strcmp0)) {
win_println(window, THEME_ONLINE, '-', " [%s] %s", option->value, option->label);
win_println(window, THEME_ONLINE, "-", " [%s] %s", option->value, option->label);
} else {
win_println(window, THEME_OFFLINE, '-', " [%s] %s", option->value, option->label);
win_println(window, THEME_OFFLINE, "-", " [%s] %s", option->value, option->label);
}
curr_option = g_slist_next(curr_option);
}
@ -315,7 +315,7 @@ _confwin_form_field(ProfWin *window, char *tag, FormField *field)
win_newline(window);
while (curr_value) {
char *value = curr_value->data;
win_println(window, THEME_ONLINE, '-', " %s", value);
win_println(window, THEME_ONLINE, "-", " %s", value);
curr_value = g_slist_next(curr_value);
}
break;

View File

@ -74,7 +74,7 @@ cons_debug(const char *const msg, ...)
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_println(console, THEME_DEFAULT, '-', "%s", fmt_msg->str);
win_println(console, THEME_DEFAULT, "-", "%s", fmt_msg->str);
g_string_free(fmt_msg, TRUE);
va_end(arg);
}
@ -88,7 +88,7 @@ cons_show(const char *const msg, ...)
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_println(console, THEME_DEFAULT, '-', "%s", fmt_msg->str);
win_println(console, THEME_DEFAULT, "-", "%s", fmt_msg->str);
g_string_free(fmt_msg, TRUE);
va_end(arg);
}
@ -112,8 +112,8 @@ cons_show_help(const char *const cmd, CommandHelp *help)
ProfWin *console = wins_get_console();
cons_show("");
win_println(console, THEME_HELP_HEADER, '-', "%s", &cmd[1]);
win_print(console, THEME_HELP_HEADER, '-', "");
win_println(console, THEME_HELP_HEADER, "-", "%s", &cmd[1]);
win_print(console, THEME_HELP_HEADER, "-", "");
int i;
for (i = 0; i < strlen(cmd) - 1 ; i++) {
win_append(console, THEME_HELP_HEADER, "-");
@ -121,12 +121,12 @@ cons_show_help(const char *const cmd, CommandHelp *help)
win_appendln(console, THEME_HELP_HEADER, "");
cons_show("");
win_println(console, THEME_HELP_HEADER, '-', "Synopsis");
win_println(console, THEME_HELP_HEADER, "-", "Synopsis");
ui_show_lines(console, help->synopsis);
cons_show("");
win_println(console, THEME_HELP_HEADER, '-', "Description");
win_println(console, THEME_DEFAULT, '-', "%s", help->desc);
win_println(console, THEME_HELP_HEADER, "-", "Description");
win_println(console, THEME_DEFAULT, "-", "%s", help->desc);
int maxlen = 0;
for (i = 0; help->args[i][0] != NULL; i++) {
@ -136,7 +136,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
if (i > 0) {
cons_show("");
win_println(console, THEME_HELP_HEADER, '-', "Arguments");
win_println(console, THEME_HELP_HEADER, "-", "Arguments");
for (i = 0; help->args[i][0] != NULL; i++) {
win_println_indent(console, maxlen + 3, "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]);
}
@ -144,7 +144,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
if (g_strv_length((gchar**)help->examples) > 0) {
cons_show("");
win_println(console, THEME_HELP_HEADER, '-', "Examples");
win_println(console, THEME_HELP_HEADER, "-", "Examples");
ui_show_lines(console, help->examples);
}
}
@ -169,7 +169,7 @@ cons_show_error(const char *const msg, ...)
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_println(console, THEME_ERROR, '-', "%s", fmt_msg->str);
win_println(console, THEME_ERROR, "-", "%s", fmt_msg->str);
g_string_free(fmt_msg, TRUE);
va_end(arg);
@ -284,7 +284,7 @@ cons_show_typing(const char *const barejid)
display_usr = barejid;
}
win_println(console, THEME_TYPING, '-', "!! %s is typing a message...", display_usr);
win_println(console, THEME_TYPING, "-", "!! %s is typing a message...", display_usr);
cons_alert();
}
@ -321,27 +321,27 @@ cons_show_incoming_room_message(const char *const nick, const char *const room,
if (g_strcmp0(muc_show, "all") == 0) {
if (mention) {
win_println(console, THEME_MENTION, '-', "<< room mention: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_MENTION, "-", "<< room mention: %s in %s (win %d)", nick, room, ui_index);
} else if (triggers) {
char *triggers_str = _room_triggers_to_string(triggers);
win_println(console, THEME_TRIGGER, '-', "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index);
win_println(console, THEME_TRIGGER, "-", "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index);
free(triggers_str);
} else {
win_println(console, THEME_INCOMING, '-', "<< room message: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_INCOMING, "-", "<< room message: %s in %s (win %d)", nick, room, ui_index);
}
cons_alert();
} else if (g_strcmp0(muc_show, "first") == 0) {
if (mention) {
win_println(console, THEME_MENTION, '-', "<< room mention: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_MENTION, "-", "<< room mention: %s in %s (win %d)", nick, room, ui_index);
cons_alert();
} else if (triggers) {
char *triggers_str = _room_triggers_to_string(triggers);
win_println(console, THEME_TRIGGER, '-', "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index);
win_println(console, THEME_TRIGGER, "-", "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index);
free(triggers_str);
cons_alert();
} else if (unread == 0) {
win_println(console, THEME_INCOMING, '-', "<< room message: %s (win %d)", room, ui_index);
win_println(console, THEME_INCOMING, "-", "<< room message: %s (win %d)", room, ui_index);
cons_alert();
}
}
@ -360,10 +360,10 @@ cons_show_incoming_message(const char *const short_from, const int win_index, in
char *chat_show = prefs_get_string(PREF_CONSOLE_CHAT);
if (g_strcmp0(chat_show, "all") == 0) {
win_println(console, THEME_INCOMING, '-', "<< chat message: %s (win %d)", short_from, ui_index);
win_println(console, THEME_INCOMING, "-", "<< chat message: %s (win %d)", short_from, ui_index);
cons_alert();
} else if ((g_strcmp0(chat_show, "first") == 0) && unread == 0) {
win_println(console, THEME_INCOMING, '-', "<< chat message: %s (win %d)", short_from, ui_index);
win_println(console, THEME_INCOMING, "-", "<< chat message: %s (win %d)", short_from, ui_index);
cons_alert();
}
@ -382,10 +382,10 @@ cons_show_incoming_private_message(const char *const nick, const char *const roo
char *priv_show = prefs_get_string(PREF_CONSOLE_PRIVATE);
if (g_strcmp0(priv_show, "all") == 0) {
win_println(console, THEME_INCOMING, '-', "<< private message: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_INCOMING, "-", "<< private message: %s in %s (win %d)", nick, room, ui_index);
cons_alert();
} else if ((g_strcmp0(priv_show, "first") == 0) && unread == 0) {
win_println(console, THEME_INCOMING, '-', "<< private message: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_INCOMING, "-", "<< private message: %s in %s (win %d)", nick, room, ui_index);
cons_alert();
}
@ -405,24 +405,24 @@ cons_about(void)
if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION
win_println(console, THEME_DEFAULT, '-', "Welcome to Profanity, version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
win_println(console, THEME_DEFAULT, "-", "Welcome to Profanity, version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
#else
win_println(console, THEME_DEFAULT, "Welcome to Profanity, version %sdev", PACKAGE_VERSION);
#endif
} else {
win_println(console, THEME_DEFAULT, '-', "Welcome to Profanity, version %s", PACKAGE_VERSION);
win_println(console, THEME_DEFAULT, "-", "Welcome to Profanity, version %s", PACKAGE_VERSION);
}
}
win_println(console, THEME_DEFAULT, '-', "Copyright (C) 2012 - 2019 James Booth <boothj5web@gmail.com>.");
win_println(console, THEME_DEFAULT, '-', "Copyright (C) 2019 - 2020 Michael Vetter <jubalh@iodoru.org>.");
win_println(console, THEME_DEFAULT, '-', "License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>");
win_println(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, '-', "This is free software; you are free to change and redistribute it.");
win_println(console, THEME_DEFAULT, '-', "There is NO WARRANTY, to the extent permitted by law.");
win_println(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, '-', "Type '/help' to show complete help.");
win_println(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, "-", "Copyright (C) 2012 - 2019 James Booth <boothj5web@gmail.com>.");
win_println(console, THEME_DEFAULT, "-", "Copyright (C) 2019 - 2020 Michael Vetter <jubalh@iodoru.org>.");
win_println(console, THEME_DEFAULT, "-", "License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>");
win_println(console, THEME_DEFAULT, "-", "");
win_println(console, THEME_DEFAULT, "-", "This is free software; you are free to change and redistribute it.");
win_println(console, THEME_DEFAULT, "-", "There is NO WARRANTY, to the extent permitted by law.");
win_println(console, THEME_DEFAULT, "-", "");
win_println(console, THEME_DEFAULT, "-", "Type '/help' to show complete help.");
win_println(console, THEME_DEFAULT, "-", "");
if (prefs_get_boolean(PREF_VERCHECK)) {
cons_check_version(FALSE);
@ -444,13 +444,13 @@ cons_check_version(gboolean not_available_msg)
if (relase_valid) {
if (release_is_new(latest_release)) {
win_println(console, THEME_DEFAULT, '-', "A new version of Profanity is available: %s", latest_release);
win_println(console, THEME_DEFAULT, '-', "Check <https://profanity-im.github.io> for details.");
win_println(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, "-", "A new version of Profanity is available: %s", latest_release);
win_println(console, THEME_DEFAULT, "-", "Check <https://profanity-im.github.io> for details.");
win_println(console, THEME_DEFAULT, "-", "");
} else {
if (not_available_msg) {
win_println(console, THEME_DEFAULT, '-', "No new version available.");
win_println(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, "-", "No new version available.");
win_println(console, THEME_DEFAULT, "-", "");
}
}
@ -466,7 +466,7 @@ cons_show_login_success(ProfAccount *account, gboolean secured)
ProfWin *console = wins_get_console();
const char *fulljid = connection_get_fulljid();
win_print(console, THEME_DEFAULT, '-', "%s logged in successfully, ", fulljid);
win_print(console, THEME_DEFAULT, "-", "%s logged in successfully, ", fulljid);
resource_presence_t presence = accounts_get_login_presence(account->name);
const char *presence_str = string_from_resource_presence(presence);
@ -500,9 +500,9 @@ cons_show_wins(gboolean unread)
GSList *curr = window_strings;
while (curr) {
if (g_strstr_len(curr->data, strlen(curr->data), " unread") > 0) {
win_println(console, THEME_CMD_WINS_UNREAD, '-', "%s", curr->data);
win_println(console, THEME_CMD_WINS_UNREAD, "-", "%s", curr->data);
} else {
win_println(console, THEME_DEFAULT, '-', "%s", curr->data);
win_println(console, THEME_DEFAULT, "-", "%s", curr->data);
}
curr = g_slist_next(curr);
}
@ -548,13 +548,13 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
const char *resource_presence = string_from_resource_presence(presence);
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_print(console, presence_colour, '-', "%s", fulljid);
win_print(console, presence_colour, "-", "%s", fulljid);
win_appendln(console, THEME_DEFAULT, ":");
// show identity
if (caps->identity) {
DiscoIdentity *identity = caps->identity;
win_print(console, THEME_DEFAULT, '-', "Identity: ");
win_print(console, THEME_DEFAULT, "-", "Identity: ");
if (identity->name) {
win_append(console, THEME_DEFAULT, "%s", identity->name);
if (identity->category || identity->type) {
@ -576,7 +576,7 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
if (caps->software_version) {
SoftwareVersion *software_version = caps->software_version;
if (software_version->software) {
win_print(console, THEME_DEFAULT, '-', "Software: %s", software_version->software);
win_print(console, THEME_DEFAULT, "-", "Software: %s", software_version->software);
}
if (software_version->software_version) {
win_append(console, THEME_DEFAULT, ", %s", software_version->software_version);
@ -585,7 +585,7 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
win_newline(console);
}
if (software_version->os) {
win_print(console, THEME_DEFAULT, '-', "OS: %s", software_version->os);
win_print(console, THEME_DEFAULT, "-", "OS: %s", software_version->os);
}
if (software_version->os_version) {
win_append(console, THEME_DEFAULT, ", %s", software_version->os_version);
@ -596,10 +596,10 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
}
if (caps->features) {
win_println(console, THEME_DEFAULT, '-', "Features:");
win_println(console, THEME_DEFAULT, "-", "Features:");
GSList *feature = caps->features;
while (feature) {
win_println(console, THEME_DEFAULT, '-', " %s", feature->data);
win_println(console, THEME_DEFAULT, "-", " %s", feature->data);
feature = g_slist_next(feature);
}
}
@ -661,7 +661,7 @@ cons_show_room_list(GSList *rooms, const char *const conference_node)
cons_show("Chat rooms at %s:", conference_node);
while (rooms) {
DiscoItem *room = rooms->data;
win_print(console, THEME_DEFAULT, '-', " %s", room->jid);
win_print(console, THEME_DEFAULT, "-", " %s", room->jid);
if (room->name) {
win_append(console, THEME_DEFAULT, ", (%s)", room->name);
}
@ -696,7 +696,7 @@ cons_show_bookmarks(const GList *list)
if (muc_active(item->barejid) && roomwin) {
presence_colour = THEME_ONLINE;
}
win_print(console, presence_colour, '-', " %s", item->barejid);
win_print(console, presence_colour, "-", " %s", item->barejid);
if (item->nick) {
win_append(console, presence_colour, "/%s", item->nick);
}
@ -776,7 +776,7 @@ cons_show_disco_items(GSList *items, const char *const jid)
cons_show("Service discovery items for %s:", jid);
while (items) {
DiscoItem *item = items->data;
win_print(console, THEME_DEFAULT, '-', " %s", item->jid);
win_print(console, THEME_DEFAULT, "-", " %s", item->jid);
if (item->name) {
win_append(console, THEME_DEFAULT, ", (%s)", item->name);
}
@ -855,7 +855,7 @@ cons_show_account_list(gchar **accounts)
(g_strcmp0(session_get_account_name(), accounts[i]) == 0)) {
resource_presence_t presence = accounts_get_last_presence(accounts[i]);
theme_item_t presence_colour = theme_main_presence_attrs(string_from_resource_presence(presence));
win_println(console, presence_colour, '-', "%s", accounts[i]);
win_println(console, presence_colour, "-", "%s", accounts[i]);
} else {
cons_show(accounts[i]);
}
@ -974,7 +974,7 @@ cons_show_account(ProfAccount *account)
GList *curr = resources;
if (curr) {
win_println(console, THEME_DEFAULT, '-', "Resources:");
win_println(console, THEME_DEFAULT, "-", "Resources:");
// sort in order of availability
while (curr) {
@ -992,7 +992,7 @@ cons_show_account(ProfAccount *account)
Resource *resource = curr->data;
const char *resource_presence = string_from_resource_presence(resource->presence);
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_print(console, presence_colour, '-', " %s (%d), %s", resource->name, resource->priority, resource_presence);
win_print(console, presence_colour, "-", " %s (%d), %s", resource->name, resource->priority, resource_presence);
if (resource->status) {
win_append(console, presence_colour, ", \"%s\"", resource->status);
@ -1006,7 +1006,7 @@ cons_show_account(ProfAccount *account)
// show identity
if (caps->identity) {
DiscoIdentity *identity = caps->identity;
win_print(console, THEME_DEFAULT, '-', " Identity: ");
win_print(console, THEME_DEFAULT, "-", " Identity: ");
if (identity->name) {
win_append(console, THEME_DEFAULT, "%s", identity->name);
if (identity->category || identity->type) {
@ -1028,7 +1028,7 @@ cons_show_account(ProfAccount *account)
if (caps->software_version) {
SoftwareVersion *software_version = caps->software_version;
if (software_version->software) {
win_print(console, THEME_DEFAULT, '-', " Software: %s", software_version->software);
win_print(console, THEME_DEFAULT, "-", " Software: %s", software_version->software);
}
if (software_version->software_version) {
win_append(console, THEME_DEFAULT, ", %s", software_version->software_version);
@ -1037,7 +1037,7 @@ cons_show_account(ProfAccount *account)
win_newline(console);
}
if (software_version->os) {
win_print(console, THEME_DEFAULT, '-', " OS: %s", software_version->os);
win_print(console, THEME_DEFAULT, "-", " OS: %s", software_version->os);
}
if (software_version->os_version) {
win_append(console, THEME_DEFAULT, ", %s", software_version->os_version);
@ -2034,8 +2034,9 @@ cons_correction_setting(void)
cons_show("Last Message Correction (XEP-0308) (/correction) : OFF");
}
char cc = prefs_get_correction_char();
char *cc = prefs_get_correction_char();
cons_show("LMC indication char (/correction char) : %c", cc);
free(cc);
}
void
@ -2071,8 +2072,9 @@ cons_show_otr_prefs(void)
}
prefs_free_string(log_value);
char ch = prefs_get_otr_char();
cons_show("OTR char (/otr char) : %c", ch);
char *ch = prefs_get_otr_char();
cons_show("OTR char (/otr char) : %s", ch);
free(ch);
if (prefs_get_boolean(PREF_OTR_SENDFILE)) {
cons_show("Allow sending unencrypted files in an OTR session via /sendfile (/otr sendfile): ON");
@ -2099,8 +2101,9 @@ cons_show_pgp_prefs(void)
}
prefs_free_string(log_value);
char ch = prefs_get_pgp_char();
cons_show("PGP char (/pgp char) : %c", ch);
char *ch = prefs_get_pgp_char();
cons_show("PGP char (/pgp char) : %s", ch);
free(ch);
if (prefs_get_boolean(PREF_PGP_SENDFILE)) {
cons_show("Allow sending unencrypted files via /sendfile while otherwise using PGP (/pgp sendfile): ON");
@ -2131,8 +2134,9 @@ cons_show_omemo_prefs(void)
}
prefs_free_string(log_value);
char ch = prefs_get_omemo_char();
cons_show("OMEMO char (/omemo char) : %c", ch);
char *ch = prefs_get_omemo_char();
cons_show("OMEMO char (/omemo char) : %s", ch);
free(ch);