about summary refs log tree commit diff stats
path: root/src/jabber.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jabber.c')
-rw-r--r--src/jabber.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/jabber.c b/src/jabber.c
index 648df07b..14739bc1 100644
--- a/src/jabber.c
+++ b/src/jabber.c
@@ -418,10 +418,16 @@ _message_handler(xmpp_conn_t * const conn,
                 log_error("Couldn't parse datetime string receiving room history: %s", utc_stamp);
             }
         } else {
-            // handle normal groupchat messages
+            xmpp_stanza_t *body = xmpp_stanza_get_child_by_name(stanza, "body");
+            if (body != NULL) {
+                char *message = xmpp_stanza_get_text(body);
+                char **tokens = g_strsplit(from, "/", 0);
+                char *room_jid = tokens[0];
+                char *nick = tokens[1];
+                win_show_room_message(room_jid, nick, message);
+            }
         }
 
-        cons_show("CHAT ROOM MESSAGE RECIEVED");
     } else {
 
         if (type != NULL) {