Log and print outgoing encrypted message
This commit is contained in:
@@ -478,7 +478,7 @@ _mucwin_print_triggers(ProfWin *window, const char *const message, GList *trigge
|
||||
}
|
||||
|
||||
void
|
||||
mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const message, GSList *mentions, GList *triggers)
|
||||
mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, prof_enc_t enc_mode)
|
||||
{
|
||||
assert(mucwin != NULL);
|
||||
|
||||
@@ -488,19 +488,43 @@ mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const mes
|
||||
char ch = '-';
|
||||
if (mucwin->message_char) {
|
||||
ch = mucwin->message_char[0];
|
||||
} else if (enc_mode == PROF_MSG_OTR) {
|
||||
ch = prefs_get_otr_char();
|
||||
} else if (enc_mode == PROF_MSG_PGP) {
|
||||
ch = prefs_get_pgp_char();
|
||||
} else if (enc_mode == PROF_MSG_OMEMO) {
|
||||
ch = prefs_get_omemo_char();
|
||||
}
|
||||
|
||||
if (g_strcmp0(nick, mynick) != 0) {
|
||||
if (g_slist_length(mentions) > 0) {
|
||||
_mucwin_print_mention(window, message, nick, mynick, mentions, &ch);
|
||||
} else if (triggers) {
|
||||
win_print_them(window, THEME_ROOMTRIGGER, ch, nick);
|
||||
_mucwin_print_triggers(window, message, triggers);
|
||||
} else {
|
||||
win_println_them_message(window, ch, nick, "%s", message);
|
||||
}
|
||||
win_println_me_message(window, ch, mynick, "%s", message);
|
||||
}
|
||||
|
||||
void
|
||||
mucwin_incoming_msg(ProfMucWin *mucwin, const char *const nick, const char *const message, GSList *mentions, GList *triggers, prof_enc_t enc_mode)
|
||||
{
|
||||
assert(mucwin != NULL);
|
||||
|
||||
ProfWin *window = (ProfWin*)mucwin;
|
||||
char *mynick = muc_nick(mucwin->roomjid);
|
||||
|
||||
char ch = '-';
|
||||
if (mucwin->message_char) {
|
||||
ch = mucwin->message_char[0];
|
||||
} else if (enc_mode == PROF_MSG_OTR) {
|
||||
ch = prefs_get_otr_char();
|
||||
} else if (enc_mode == PROF_MSG_PGP) {
|
||||
ch = prefs_get_pgp_char();
|
||||
} else if (enc_mode == PROF_MSG_OMEMO) {
|
||||
ch = prefs_get_omemo_char();
|
||||
}
|
||||
|
||||
if (g_slist_length(mentions) > 0) {
|
||||
_mucwin_print_mention(window, message, nick, mynick, mentions, &ch);
|
||||
} else if (triggers) {
|
||||
win_print_them(window, THEME_ROOMTRIGGER, ch, nick);
|
||||
_mucwin_print_triggers(window, message, triggers);
|
||||
} else {
|
||||
win_println_me_message(window, ch, mynick, "%s", message);
|
||||
win_println_them_message(window, ch, nick, "%s", message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,8 @@ void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char
|
||||
const char *const role, const char *const affiliation, const char *const actor, const char *const reason);
|
||||
void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char *const presence);
|
||||
void mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp, const char *const message);
|
||||
void mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const message, GSList *mentions, GList *triggers);
|
||||
void mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, prof_enc_t enc_mode);
|
||||
void mucwin_incoming_msg(ProfMucWin *mucwin, const char *const nick, const char *const message, GSList *mentions, GList *triggers, prof_enc_t enc_mode);
|
||||
void mucwin_subject(ProfMucWin *mucwin, const char *const nick, const char *const subject);
|
||||
void mucwin_requires_config(ProfMucWin *mucwin);
|
||||
void mucwin_info(ProfMucWin *mucwin);
|
||||
|
||||
@@ -197,6 +197,7 @@ win_create_muc(const char *const roomjid)
|
||||
}
|
||||
new_win->enctext = NULL;
|
||||
new_win->message_char = NULL;
|
||||
new_win->is_omemo = FALSE;
|
||||
|
||||
new_win->memcheck = PROFMUCWIN_MEMCHECK;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user