about summary refs log tree commit diff stats
path: root/src/jabber.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-11-05 22:28:06 +0000
committerJames Booth <boothj5@gmail.com>2012-11-05 22:28:06 +0000
commit0023422830d4f593df69b32cb9a214ed1f18ab6d (patch)
tree12936198f25a5e1303fc6e068918964b37969952 /src/jabber.c
parentad8845991cd6dcc2ec912fc991b3791242c55f1f (diff)
downloadprofani-tty-0023422830d4f593df69b32cb9a214ed1f18ab6d.tar.gz
Handle incoming groupchat
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) {