mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Changed parameter to contact_list_add jid->barejid
This commit is contained in:
parent
facb2a653b
commit
835906bada
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user