diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-12-08 12:26:36 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-12-08 12:26:36 +0100 |
commit | 3e26364579d49aae70fa54addbd271b3aee3d968 (patch) | |
tree | b8699fbcce5540e4b41ba8d782e425b7a1fcf191 /src | |
parent | f023d56b02eec67ea357a85d7f8ec325f87622e3 (diff) | |
download | profani-tty-3e26364579d49aae70fa54addbd271b3aee3d968.tar.gz |
Fix chatlogs for outgoing carbons
Doesn't make sense to log if plain is not set in all cases. Regards https://github.com/profanity-im/profanity/issues/1439
Diffstat (limited to 'src')
-rw-r--r-- | src/event/server_events.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c index 27f142eb..3e51d969 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -448,16 +448,6 @@ sv_ev_outgoing_carbon(ProfMessage* message) chat_state_active(chatwin->state); - if (message->plain) { - if (message->type == PROF_MSG_TYPE_MUCPM) { - // MUC PM, should have resource (nick) in filename - chat_log_msg_out(message->to_jid->barejid, message->plain, message->from_jid->resourcepart); - } else { - chat_log_msg_out(message->to_jid->barejid, message->plain, NULL); - } - log_database_add_incoming(message); - } - if (message->enc == PROF_MSG_ENC_OMEMO) { chatwin_outgoing_carbon(chatwin, message); } else if (message->encrypted) { @@ -481,6 +471,16 @@ sv_ev_outgoing_carbon(ProfMessage* message) message->plain = strdup(message->body); chatwin_outgoing_carbon(chatwin, message); } + + if (message->plain) { + if (message->type == PROF_MSG_TYPE_MUCPM) { + // MUC PM, should have resource (nick) in filename + chat_log_msg_out(message->to_jid->barejid, message->plain, message->from_jid->resourcepart); + } else { + chat_log_msg_out(message->to_jid->barejid, message->plain, NULL); + } + log_database_add_incoming(message); + } return; } |