diff options
author | James Booth <boothj5@gmail.com> | 2012-11-06 22:46:28 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-11-06 22:46:28 +0000 |
commit | 9872708755c967ca228e0ce4ee7fa5adb7dd039c (patch) | |
tree | bceaa36f90fa0c18ef116f98c0652282918a8ae0 /src | |
parent | 4493f5553038ef181228d5382a83ef6950c168c1 (diff) | |
download | profani-tty-9872708755c967ca228e0ce4ee7fa5adb7dd039c.tar.gz |
Commented jabber message handler
Diffstat (limited to 'src')
-rw-r--r-- | src/jabber.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/jabber.c b/src/jabber.c index 5ec61665..3b1b9be3 100644 --- a/src/jabber.c +++ b/src/jabber.c @@ -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) { |