about summary refs log tree commit diff stats
path: root/src/event
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-05-27 22:06:04 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-05-27 22:06:04 +0200
commitd4692b1b2dfc6eca947d3d5cbe19901306837ccd (patch)
treee9196d092decb7b4a4af9703655585175dcf8cc8 /src/event
parentd240eb629cbe8cfc7e7f51ab95d44f993088810c (diff)
downloadprofani-tty-d4692b1b2dfc6eca947d3d5cbe19901306837ccd.tar.gz
Fix carbon logging
Regards https://github.com/profanity-im/profanity/issues/1342
Diffstat (limited to 'src/event')
-rw-r--r--src/event/server_events.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c
index 542a974e..d082356f 100644
--- a/src/event/server_events.c
+++ b/src/event/server_events.c
@@ -440,20 +440,19 @@ sv_ev_delayed_private_message(ProfMessage *message)
 void
 sv_ev_outgoing_carbon(ProfMessage *message)
 {
-    ProfChatWin *chatwin = wins_get_chat(message->from_jid->barejid);
+    ProfChatWin *chatwin = wins_get_chat(message->to_jid->barejid);
     if (!chatwin) {
-        chatwin = chatwin_new(message->from_jid->barejid);
+        chatwin = chatwin_new(message->to_jid->barejid);
     }
 
     chat_state_active(chatwin->state);
 
-    //TODO: check whether we need to change from and to for carbon. now that we have profmessage->to_jid?
     if (message->plain) {
         if (message->type == PROF_MSG_TYPE_MUCPM) {
             // MUC PM, should have resource (nick) in filename
-            chat_log_msg_out(message->from_jid->barejid, message->plain, message->from_jid->resourcepart);
+            chat_log_msg_out(message->to_jid->barejid, message->plain, message->from_jid->resourcepart);
         } else {
-            chat_log_msg_out(message->from_jid->barejid, message->plain, NULL);
+            chat_log_msg_out(message->to_jid->barejid, message->plain, NULL);
         }
         log_database_add_incoming(message);
     }
@@ -782,7 +781,6 @@ sv_ev_incoming_message(ProfMessage *message)
 void
 sv_ev_incoming_carbon(ProfMessage *message)
 {
-    //TODO: check whether we need to change from and to for carbon. now that we have profmessage->to_jid?
     gboolean new_win = FALSE;
     ProfChatWin *chatwin = wins_get_chat(message->from_jid->barejid);
     if (!chatwin) {