Handle incoming groupchat

This commit is contained in:
James Booth
2012-11-05 22:28:06 +00:00
parent ad8845991c
commit 0023422830
3 changed files with 25 additions and 2 deletions

View File

@@ -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) {