diff options
author | James Booth <boothj5@gmail.com> | 2012-08-16 00:50:32 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-08-16 00:50:32 +0100 |
commit | 8b1653f7076c61f317446b7c80093ab0a0381e35 (patch) | |
tree | e7af6b8b64a94a50c5527d3a985fc3bf7b2a4edc /src/jabber.c | |
parent | a7c7768778f005aec8b11512743924d5270b3e07 (diff) | |
download | profani-tty-8b1653f7076c61f317446b7c80093ab0a0381e35.tar.gz |
Added typing notifications and related preferences
Diffstat (limited to 'src/jabber.c')
-rw-r--r-- | src/jabber.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/jabber.c b/src/jabber.c index 1d8a3dde..1090302c 100644 --- a/src/jabber.c +++ b/src/jabber.c @@ -259,18 +259,22 @@ _jabber_message_handler(xmpp_conn_t * const conn, // if no message, check for chatstates if (body == NULL) { - if (xmpp_stanza_get_child_by_name(stanza, "active") != NULL) { - // active - } else if (xmpp_stanza_get_child_by_name(stanza, "composing") != NULL) { - // composing - char *from = xmpp_stanza_get_attribute(stanza, "from"); - cons_show(from); - cons_show("is composing a message"); + + if (prefs_get_typing()) { + if (xmpp_stanza_get_child_by_name(stanza, "active") != NULL) { + // active + } else if (xmpp_stanza_get_child_by_name(stanza, "composing") != NULL) { + // composing + char *from = xmpp_stanza_get_attribute(stanza, "from"); + win_show_typing(from); + win_page_off(); + } } return 1; } + // message body recieved char *type = xmpp_stanza_get_attribute(stanza, "type"); if(strcmp(type, "error") == 0) return 1; |