[Telepathy-commits] [telepathy-salut/master] salut_muc_channel_close: raise an error if the channel is already closed

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu Nov 27 02:59:35 PST 2008


---
 src/salut-muc-channel.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/salut-muc-channel.c b/src/salut-muc-channel.c
index 88fdd77..7fbf1f2 100644
--- a/src/salut-muc-channel.c
+++ b/src/salut-muc-channel.c
@@ -1332,6 +1332,16 @@ salut_muc_channel_close (TpSvcChannel *iface, DBusGMethodInvocation *context)
   SalutMucChannel *self = SALUT_MUC_CHANNEL (iface);
   SalutMucChannelPrivate *priv = SALUT_MUC_CHANNEL_GET_PRIVATE (self);
 
+  if (priv->closed)
+    {
+      GError already = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+          "Channel already closed"};
+      DEBUG ("channel already closed");
+
+      dbus_g_method_return_error (context, &already);
+      return;
+    }
+
   if (priv->connected)
     {
       /* priv->closed will be set in salut_muc_channel_disconnected */
-- 
1.5.6.5




More information about the Telepathy-commits mailing list