Added check members only room to send mediated invites

This commit is contained in:
James Booth
2015-03-28 22:51:41 +00:00
parent f1f047889e
commit fac2b2cf66
6 changed files with 77 additions and 1 deletions

View File

@@ -62,6 +62,7 @@ typedef struct _muc_room_t {
Autocomplete jid_ac;
GHashTable *nick_changes;
gboolean roster_received;
muc_member_type_t member_type;
} ChatRoom;
GHashTable *rooms = NULL;
@@ -177,6 +178,7 @@ muc_join(const char * const room, const char * const nick,
new_room->roster_received = FALSE;
new_room->pending_nick_change = FALSE;
new_room->autojoin = autojoin;
new_room->member_type = MUC_MEMBER_TYPE_UNKNOWN;
g_hash_table_insert(rooms, strdup(room), new_room);
}
@@ -763,6 +765,18 @@ muc_set_affiliation(const char * const room, const char * const affiliation)
}
}
muc_member_type_t
muc_member_type(const char * const room)
{
ChatRoom *chat_room = g_hash_table_lookup(rooms, room);
if (chat_room) {
return chat_room->member_type;
} else {
return MUC_MEMBER_TYPE_UNKNOWN;
}
}
static void
_free_room(ChatRoom *room)
{