Added roster struct, create and destroy roster on connect/disconnect

This commit is contained in:
James Booth
2016-01-05 00:06:50 +00:00
parent 8e9bf08389
commit 055a5f71ce
18 changed files with 409 additions and 326 deletions

View File

@@ -403,15 +403,18 @@ _show_contact_presence(ProfChatWin *chatwin)
theme_item_t presence_colour = THEME_TITLE_OFFLINE;
const char *presence = "offline";
PContact contact = roster_get_contact(chatwin->barejid);
if (contact) {
if (resource) {
Resource *resourcep = p_contact_get_resource(contact, resource);
if (resourcep) {
presence = string_from_resource_presence(resourcep->presence);
jabber_conn_status_t conn_status = jabber_get_connection_status();
if (conn_status == JABBER_CONNECTED) {
PContact contact = roster_get_contact(chatwin->barejid);
if (contact) {
if (resource) {
Resource *resourcep = p_contact_get_resource(contact, resource);
if (resourcep) {
presence = string_from_resource_presence(resourcep->presence);
}
} else {
presence = p_contact_presence(contact);
}
} else {
presence = p_contact_presence(contact);
}
}