Added typing notifications and related preferences

This commit is contained in:
James Booth
2012-08-16 00:50:32 +01:00
parent a7c7768778
commit 8b1653f707
6 changed files with 152 additions and 13 deletions

View File

@@ -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;