Added /roster show|hide unsubscribed

This commit is contained in:
James Booth
2016-02-07 00:49:48 +00:00
parent 6702bb9739
commit abc2f0de39
14 changed files with 186 additions and 0 deletions

View File

@@ -106,6 +106,35 @@ wins_get_chat(const char *const barejid)
return NULL;
}
static gint
_cmp_unsubscribed_wins(ProfChatWin *a, ProfChatWin *b)
{
return g_strcmp0(a->barejid, b->barejid);
}
GList*
wins_get_chat_unsubscribed(void)
{
GList *result = NULL;
GList *values = g_hash_table_get_values(windows);
GList *curr = values;
while (curr) {
ProfWin *window = curr->data;
if (window->type == WIN_CHAT) {
ProfChatWin *chatwin = (ProfChatWin*)window;
PContact contact = roster_get_contact(chatwin->barejid);
if (contact == NULL) {
result = g_list_insert_sorted(result, chatwin, (GCompareFunc)_cmp_unsubscribed_wins);
}
}
curr = g_list_next(curr);
}
g_list_free(values);
return result;
}
ProfMucConfWin*
wins_get_muc_conf(const char *const roomjid)
{