1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Commented jabber message handler

This commit is contained in:
James Booth 2012-11-06 22:46:28 +00:00
parent 4493f55530
commit 9872708755

View File

@ -446,11 +446,15 @@ _message_handler(xmpp_conn_t * const conn,
type = xmpp_stanza_get_attribute(stanza, "type");
from = xmpp_stanza_get_attribute(stanza, "from");
// handle groupchat messages
if (room_jid_is_room_chat(from)) {
xmpp_stanza_t *delay = xmpp_stanza_get_child_by_name(stanza, "delay");
// handle chat room history
if (delay != NULL) {
char *utc_stamp = xmpp_stanza_get_attribute(delay, "stamp");
GTimeVal tv_stamp;
if(g_time_val_from_iso8601(utc_stamp, &tv_stamp)) {
xmpp_stanza_t *body = xmpp_stanza_get_child_by_name(stanza, "body");
if (body != NULL) {
@ -464,6 +468,8 @@ _message_handler(xmpp_conn_t * const conn,
} else {
log_error("Couldn't parse datetime string receiving room history: %s", utc_stamp);
}
// handle regular chat room message
} else {
xmpp_stanza_t *body = xmpp_stanza_get_child_by_name(stanza, "body");
if (body != NULL) {
@ -476,6 +482,7 @@ _message_handler(xmpp_conn_t * const conn,
}
}
// handle regular messaging
} else {
if (type != NULL) {