From 20f55984143346d4a9939bf4fcc21c0779be4893 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 11 May 2011 21:00:36 +0300 Subject: [PATCH 2/4] Add idle_muc_channel_is_typechar as per RFC 2811 --- src/idle-muc-channel.c | 21 +++++++++++++++++++++ src/idle-muc-channel.h | 1 + 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/src/idle-muc-channel.c b/src/idle-muc-channel.c index 83e0ea2..8afc0ce 100644 --- a/src/idle-muc-channel.c +++ b/src/idle-muc-channel.c @@ -2391,6 +2391,27 @@ gboolean idle_muc_channel_is_modechar(char c) { } } +gboolean idle_muc_channel_is_typechar(gchar c) +{ + switch (c) { + /* standard channel */ + case '#': + + /* local to a server */ + case '&': + + /* no support for modes */ + case '+': + + /* safe channel */ + case '!': + return TRUE; + + default: + return FALSE; + } +} + static void _channel_iface_init(gpointer g_iface, gpointer iface_data) { TpSvcChannelClass *klass = (TpSvcChannelClass *)g_iface; diff --git a/src/idle-muc-channel.h b/src/idle-muc-channel.h index c231b04..15c55c6 100644 --- a/src/idle-muc-channel.h +++ b/src/idle-muc-channel.h @@ -76,6 +76,7 @@ IdleMUCChannel *idle_muc_channel_new(IdleConnection *conn, const gchar *object_p void idle_muc_channel_badchannelkey(IdleMUCChannel *chan); void idle_muc_channel_invited(IdleMUCChannel *chan, TpHandle inviter); gboolean idle_muc_channel_is_modechar(char c); +gboolean idle_muc_channel_is_typechar(char c); void idle_muc_channel_join(IdleMUCChannel *chan, TpHandle joiner); void idle_muc_channel_join_attempt(IdleMUCChannel *chan); void idle_muc_channel_join_error(IdleMUCChannel *chan, IdleMUCChannelJoinError err); -- 1.7.4.4