1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Merge pull request #1446 from profanity-im/fix/1439-chatlogs

Fix chatlogs for outgoing carbons
This commit is contained in:
Michael Vetter 2020-12-10 08:41:57 +01:00 committed by GitHub
commit 150ce3520b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
@ -659,14 +659,19 @@ sv_ev_incoming_carbon(ProfMessage* message)
#endif
}
gboolean logit = TRUE;
if (message->type == PROF_MSG_TYPE_MUCPM) {
logit = FALSE;
}
if (message->enc == PROF_MSG_ENC_OX) {
_sv_ev_incoming_ox(chatwin, new_win, message, FALSE);
_sv_ev_incoming_ox(chatwin, new_win, message, logit);
} else if (message->encrypted) {
_sv_ev_incoming_pgp(chatwin, new_win, message, FALSE);
_sv_ev_incoming_pgp(chatwin, new_win, message, logit);
} else if (message->enc == PROF_MSG_ENC_OMEMO) {
_sv_ev_incoming_omemo(chatwin, new_win, message, FALSE);
_sv_ev_incoming_omemo(chatwin, new_win, message, logit);
} else {
_sv_ev_incoming_plain(chatwin, new_win, message, FALSE);
_sv_ev_incoming_plain(chatwin, new_win, message, logit);
}
rosterwin_roster();
return;