diff options
author | James Booth <boothj5@gmail.com> | 2014-09-03 22:56:33 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-09-03 22:56:33 +0100 |
commit | b50b786dcc39cd0eabff6ea0880759291b9b9b0b (patch) | |
tree | bf0d60dbc28c08ddf5331dd6c124a6fc09ed9b10 /src/muc.c | |
parent | 64521eb135229c8c6905b6c74668142eaf441a32 (diff) | |
download | profani-tty-b50b786dcc39cd0eabff6ea0880759291b9b9b0b.tar.gz |
Validate usage of /room config command, added UI messages
Diffstat (limited to 'src/muc.c')
-rw-r--r-- | src/muc.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/muc.c b/src/muc.c index 053eb38b..3aef0220 100644 --- a/src/muc.c +++ b/src/muc.c @@ -49,6 +49,7 @@ typedef struct _muc_room_t { char *password; char *subject; char *autocomplete_prefix; + gboolean pending_config; GList *pending_broadcasts; gboolean autojoin; gboolean pending_nick_change; @@ -162,6 +163,7 @@ muc_join_room(const char * const room, const char * const nick, } new_room->subject = NULL; new_room->pending_broadcasts = NULL; + new_room->pending_config = FALSE; new_room->roster = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)p_contact_free); new_room->nick_ac = autocomplete_new(); @@ -185,6 +187,39 @@ muc_leave_room(const char * const room) } } +gboolean +muc_requires_config(const char * const room) +{ + if (rooms == NULL) { + return FALSE; + } + + ChatRoom *chat_room = g_hash_table_lookup(rooms, room); + + if (chat_room == NULL) { + return FALSE; + } + + return chat_room->pending_config; +} + +void +muc_set_requires_config(const char * const room, gboolean val) +{ + if (rooms == NULL) { + return; + } + + ChatRoom *chat_room = g_hash_table_lookup(rooms, room); + + if (chat_room == NULL) { + return; + } + + chat_room->pending_config = val; + return; +} + /* * Returns TRUE if the user is currently in the room */ |