Set members only property when getting room features

This commit is contained in:
James Booth
2015-03-29 00:21:18 +00:00
parent fac2b2cf66
commit 24a45e5292
6 changed files with 26 additions and 4 deletions

View File

@@ -210,6 +210,19 @@ muc_set_requires_config(const char * const room, gboolean val)
}
}
void
muc_set_features(const char * const room, GSList *features)
{
ChatRoom *chat_room = g_hash_table_lookup(rooms, room);
if (chat_room && features) {
if (g_slist_find_custom(features, "muc_membersonly", (GCompareFunc)g_strcmp0)) {
chat_room->member_type = MUC_MEMBER_TYPE_MEMBERS_ONLY;
} else {
chat_room->member_type = MUC_MEMBER_TYPE_PUBLIC;
}
}
}
/*
* Returns TRUE if the user is currently in the room
*/