Show encryption for historical messages
Refactor getting char, introduce get_show_char() to follow DRY principle. In theory, performance might be negatively affected after this change. Ideally get_show_char should be optimized in the future.
This commit is contained in:
@@ -433,16 +433,8 @@ chatwin_outgoing_msg(ProfChatWin* chatwin, const char* const message, char* id,
|
||||
auto_char char* enc_char;
|
||||
if (chatwin->outgoing_char) {
|
||||
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 if (enc_mode == PROF_MSG_ENC_OX) {
|
||||
enc_char = prefs_get_ox_char();
|
||||
} else {
|
||||
enc_char = strdup("-");
|
||||
enc_char = get_show_char(enc_mode);
|
||||
}
|
||||
|
||||
if (request_receipt && id) {
|
||||
|
||||
Reference in New Issue
Block a user