Added ui_contact_online
This commit is contained in:
@@ -319,6 +319,42 @@ ui_chat_win_exists(const char * const barejid)
|
||||
return (chatwin != NULL);
|
||||
}
|
||||
|
||||
void
|
||||
ui_contact_online(char *barejid, Resource *resource, GDateTime *last_activity)
|
||||
{
|
||||
char *show_console = prefs_get_string(PREF_STATUSES_CONSOLE);
|
||||
char *show_chat_win = prefs_get_string(PREF_STATUSES_CHAT);
|
||||
PContact contact = roster_get_contact(barejid);
|
||||
|
||||
// show nothing
|
||||
if (g_strcmp0(p_contact_subscription(contact), "none") == 0) {
|
||||
free(show_console);
|
||||
free(show_chat_win);
|
||||
return;
|
||||
}
|
||||
|
||||
// show in console if "all"
|
||||
if (g_strcmp0(show_console, "all") == 0) {
|
||||
cons_show_contact_online(contact, resource, last_activity);
|
||||
|
||||
// show in console of "online" and presence online
|
||||
} else if (g_strcmp0(show_console, "online") == 0 && resource->presence == RESOURCE_ONLINE) {
|
||||
cons_show_contact_online(contact, resource, last_activity);
|
||||
}
|
||||
|
||||
// show in chat win if "all"
|
||||
if (g_strcmp0(show_chat_win, "all") == 0) {
|
||||
ui_chat_win_contact_online(contact, resource, last_activity);
|
||||
|
||||
// show in char win if "online" and presence online
|
||||
} else if (g_strcmp0(show_chat_win, "online") == 0 && resource->presence == RESOURCE_ONLINE) {
|
||||
ui_chat_win_contact_online(contact, resource, last_activity);
|
||||
}
|
||||
|
||||
free(show_console);
|
||||
free(show_chat_win);
|
||||
}
|
||||
|
||||
void
|
||||
ui_contact_typing(const char * const barejid, const char * const resource)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user