about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/config/theme.c2
-rw-r--r--src/event/server_events.c33
2 files changed, 20 insertions, 15 deletions
diff --git a/src/config/theme.c b/src/config/theme.c
index 2ec256ad..404a34d3 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -712,7 +712,7 @@ theme_hash_attrs(const char* str)
     return COLOR_PAIR(color_pair_cache_hash_str(str, profile));
 }
 
-/* returns the colours (fgnd and bknd) for a certian attribute ie main.text */
+/* returns the colours (fgnd and bknd) for a certain attribute ie main.text */
 int
 theme_attrs(theme_item_t attrs)
 {
diff --git a/src/event/server_events.c b/src/event/server_events.c
index 27f142eb..0d9d9523 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;
 }
 
@@ -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;