Added roster struct, create and destroy roster on connect/disconnect
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user