diff options
author | James Booth <boothj5@gmail.com> | 2015-02-23 23:14:55 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-02-23 23:14:55 +0000 |
commit | e22547fb19872bffeaedf69e03024c0e6057b429 (patch) | |
tree | c4a18806d93b99038be4af0b5c984a142942e8ff /src | |
parent | 7454bede8b67003ea17017fa4dd8a7b86f42d6b6 (diff) | |
parent | a2a187892b7bb0a343b8bbe3c46dee051d534bde (diff) | |
download | profani-tty-e22547fb19872bffeaedf69e03024c0e6057b429.tar.gz |
Merge branch 'master' into readline
Diffstat (limited to 'src')
-rw-r--r-- | src/xmpp/roster.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c index e6f4c2ca..1e943fb6 100644 --- a/src/xmpp/roster.c +++ b/src/xmpp/roster.c @@ -241,6 +241,7 @@ _roster_set_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, jid_destroy(my_jid); const char *barejid = xmpp_stanza_get_attribute(item, STANZA_ATTR_JID); + gchar *barejid_lower = g_utf8_strdown(barejid, -1); const char *name = xmpp_stanza_get_attribute(item, STANZA_ATTR_NAME); const char *sub = xmpp_stanza_get_attribute(item, STANZA_ATTR_SUBSCRIPTION); const char *ask = xmpp_stanza_get_attribute(item, STANZA_ATTR_ASK); @@ -254,12 +255,12 @@ _roster_set_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, if (g_strcmp0(sub, "remove") == 0) { // remove barejid and name if (name == NULL) { - name = barejid; + name = barejid_lower; } - roster_remove(name, barejid); + roster_remove(name, barejid_lower); - handle_roster_remove(barejid); + handle_roster_remove(barejid_lower); // otherwise update local roster } else { @@ -273,14 +274,14 @@ _roster_set_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, GSList *groups = _get_groups_from_item(item); // update the local roster - PContact contact = roster_get_contact(barejid); + PContact contact = roster_get_contact(barejid_lower); if (contact == NULL) { - gboolean added = roster_add(barejid, name, groups, sub, pending_out); + gboolean added = roster_add(barejid_lower, name, groups, sub, pending_out); if (added) { - handle_roster_add(barejid, name); + handle_roster_add(barejid_lower, name); } } else { - handle_roster_update(barejid, name, groups, sub, pending_out); + handle_roster_update(barejid_lower, name, groups, sub, pending_out); } } @@ -300,6 +301,7 @@ _roster_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, while (item != NULL) { const char *barejid = xmpp_stanza_get_attribute(item, STANZA_ATTR_JID); + gchar *barejid_lower = g_utf8_strdown(barejid, -1); const char *name = xmpp_stanza_get_attribute(item, STANZA_ATTR_NAME); const char *sub = xmpp_stanza_get_attribute(item, STANZA_ATTR_SUBSCRIPTION); @@ -316,10 +318,10 @@ _roster_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, GSList *groups = _get_groups_from_item(item); - gboolean added = roster_add(barejid, name, groups, sub, pending_out); + gboolean added = roster_add(barejid_lower, name, groups, sub, pending_out); if (!added) { - log_warning("Attempt to add contact twice: %s", barejid); + log_warning("Attempt to add contact twice: %s", barejid_lower); } item = xmpp_stanza_get_next(item); |