summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2006-08-09 16:27:30 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2006-08-09 16:27:30 +0000
commite100ffe485ccec9bcec58201d84627ca89e63b34 (patch)
treeb6cb5f787514facf66674284e93951fd87760fa6 /src
parent3fe3ca15d13a0dfe0d3ab6c1b84a3692e8a76884 (diff)
downloadtelepathy-glib-e100ffe485ccec9bcec58201d84627ca89e63b34.tar.gz
gabble-muc-channel.c: Fill in reason_code when kicked or banned
20060809162730-53eee-766a54ed5ba1d6d3c8ad8d7baf34d1478d3e5e67.gz
Diffstat (limited to 'src')
-rw-r--r--src/gabble-muc-channel.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gabble-muc-channel.c b/src/gabble-muc-channel.c
index 9cf9a7e96..a911c9f21 100644
--- a/src/gabble-muc-channel.c
+++ b/src/gabble-muc-channel.c
@@ -1403,6 +1403,25 @@ _gabble_muc_channel_member_presence_updated (GabbleMucChannel *chan,
}
}
+ /* Possible reasons we could have been removed from the room:
+ * 301 banned
+ * 307 kicked
+ * 321 "because of an affiliation change" - no reason_code
+ * 322 room has become members-only and we're not a member - no reason_code
+ * 332 system (server) is being shut down - no reason code
+ */
+ if (status_code)
+ {
+ if (strcmp (status_code, "301") == 0)
+ {
+ reason_code = TP_CHANNEL_GROUP_CHANGE_REASON_BANNED;
+ }
+ else if (strcmp (status_code, "307") == 0)
+ {
+ reason_code = TP_CHANNEL_GROUP_CHANGE_REASON_KICKED;
+ }
+ }
+
reason_node = lm_message_node_get_child (item_node, "reason");
if (reason_node != NULL)
{