diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/contact_list.c | 30 | ||||
-rw-r--r-- | src/contact_list.h | 10 | ||||
-rw-r--r-- | src/xmpp/iq.c | 6 |
3 files changed, 23 insertions, 23 deletions
diff --git a/src/contact_list.c b/src/contact_list.c index b9db1289..43868b71 100644 --- a/src/contact_list.c +++ b/src/contact_list.c @@ -61,18 +61,18 @@ contact_list_reset_search_attempts(void) } gboolean -contact_list_add(const char * const jid, const char * const name, +contact_list_add(const char * const barejid, const char * const name, const char * const presence, const char * const status, const char * const subscription, gboolean pending_out) { gboolean added = FALSE; - PContact contact = g_hash_table_lookup(contacts, jid); + PContact contact = g_hash_table_lookup(contacts, barejid); if (contact == NULL) { - contact = p_contact_new(jid, name, presence, status, subscription, + contact = p_contact_new(barejid, name, presence, status, subscription, pending_out, NULL); - g_hash_table_insert(contacts, strdup(jid), contact); - autocomplete_add(ac, strdup(jid)); + g_hash_table_insert(contacts, strdup(barejid), contact); + autocomplete_add(ac, strdup(barejid)); added = TRUE; } @@ -80,17 +80,17 @@ contact_list_add(const char * const jid, const char * const name, } void -contact_list_remove(const char * const jid) +contact_list_remove(const char * const barejid) { - g_hash_table_remove(contacts, jid); + g_hash_table_remove(contacts, barejid); } gboolean -contact_list_update_contact(const char * const jid, const char * const presence, +contact_list_update_contact(const char * const barejid, const char * const presence, const char * const status, GDateTime *last_activity, const char * const caps_str) { gboolean presence_changed = FALSE; - PContact contact = g_hash_table_lookup(contacts, jid); + PContact contact = g_hash_table_lookup(contacts, barejid); if (contact == NULL) { return FALSE; @@ -119,15 +119,15 @@ contact_list_update_contact(const char * const jid, const char * const presence, } void -contact_list_update_subscription(const char * const jid, +contact_list_update_subscription(const char * const barejid, const char * const subscription, gboolean pending_out) { - PContact contact = g_hash_table_lookup(contacts, jid); + PContact contact = g_hash_table_lookup(contacts, barejid); if (contact == NULL) { - contact = p_contact_new(jid, NULL, "offline", NULL, subscription, + contact = p_contact_new(barejid, NULL, "offline", NULL, subscription, pending_out, NULL); - g_hash_table_insert(contacts, strdup(jid), contact); + g_hash_table_insert(contacts, strdup(barejid), contact); } else { p_contact_set_subscription(contact, subscription); p_contact_set_pending_out(contact, pending_out); @@ -176,9 +176,9 @@ contact_list_find_contact(char *search_str) } PContact -contact_list_get_contact(const char const *jid) +contact_list_get_contact(const char const *barejid) { - return g_hash_table_lookup(contacts, jid); + return g_hash_table_lookup(contacts, barejid); } static diff --git a/src/contact_list.h b/src/contact_list.h index 43350631..c1ccf152 100644 --- a/src/contact_list.h +++ b/src/contact_list.h @@ -31,17 +31,17 @@ void contact_list_init(void); void contact_list_clear(void); void contact_list_free(void); void contact_list_reset_search_attempts(void); -void contact_list_remove(const char * const jid); -gboolean contact_list_add(const char * const jid, const char * const name, +void contact_list_remove(const char * const barejid); +gboolean contact_list_add(const char * const barejid, const char * const name, const char * const presence, const char * const status, const char * const subscription, gboolean pending_out); -gboolean contact_list_update_contact(const char * const jid, const char * const presence, +gboolean contact_list_update_contact(const char * const barejid, const char * const presence, const char * const status, GDateTime *last_activity, const char * const caps_str); -void contact_list_update_subscription(const char * const jid, +void contact_list_update_subscription(const char * const barejid, const char * const subscription, gboolean pending_out); gboolean contact_list_has_pending_subscriptions(void); GSList * get_contact_list(void); char * contact_list_find_contact(char *search_str); -PContact contact_list_get_contact(const char const *jid); +PContact contact_list_get_contact(const char const *barejid); #endif diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 7a5c2d24..9954da1e 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -134,7 +134,7 @@ _iq_handle_roster_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, xmpp_stanza_t *item = xmpp_stanza_get_children(query); while (item != NULL) { - const char *jid = xmpp_stanza_get_attribute(item, STANZA_ATTR_JID); + const char *barejid = xmpp_stanza_get_attribute(item, STANZA_ATTR_JID); const char *name = xmpp_stanza_get_attribute(item, STANZA_ATTR_NAME); const char *sub = xmpp_stanza_get_attribute(item, STANZA_ATTR_SUBSCRIPTION); @@ -144,11 +144,11 @@ _iq_handle_roster_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, pending_out = TRUE; } - gboolean added = contact_list_add(jid, name, "offline", NULL, sub, + gboolean added = contact_list_add(barejid, name, "offline", NULL, sub, pending_out); if (!added) { - log_warning("Attempt to add contact twice: %s", jid); + log_warning("Attempt to add contact twice: %s", barejid); } item = xmpp_stanza_get_next(item); |