Dealing with mulitple contact resources, work in progress

This commit is contained in:
James Booth
2013-02-14 23:24:00 +00:00
parent e33ccb07a4
commit 6794fb8101
4 changed files with 113 additions and 38 deletions

View File

@@ -217,13 +217,13 @@ muc_add_to_roster(const char * const room, const char * const nick,
updated = TRUE;
autocomplete_add(chat_room->nick_ac, strdup(nick));
} else if ((g_strcmp0(p_contact_presence(old), show) != 0) ||
(g_strcmp0(p_contact_status(old), status) != 0)) {
(g_strcmp0(p_contact_status(old, nick), status) != 0)) {
updated = TRUE;
}
PContact contact = p_contact_new(nick, NULL, NULL, FALSE);
resource_presence_t resource_presence = resource_presence_from_string(show);
Resource *resource = resource_new("default", resource_presence, status, 0, caps_str);
p_contact_add_resource(contact, resource);
Resource *resource = resource_new(nick, resource_presence, status, 0, caps_str);
p_contact_set_presence(contact, resource);
g_hash_table_replace(chat_room->roster, strdup(nick), contact);
}