[telepathy-sofiasip/master] Disable hold if the media channel contents are not mutable

Mikhail Zabaluev mikhail.zabaluev at nokia.com
Fri Jan 8 10:38:34 PST 2010


Also added a TODO note for modifying RequestStreamDirection in the same manner.
---
 src/sip-media-channel.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/sip-media-channel.c b/src/sip-media-channel.c
index 927aa80..0b09d19 100644
--- a/src/sip-media-channel.c
+++ b/src/sip-media-channel.c
@@ -874,6 +874,8 @@ tpsip_media_channel_request_stream_direction (TpSvcChannelTypeStreamedMedia *ifa
 
   priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self);
 
+  /* TODO: find out if it's practical to disable this when
+   * priv->immutable_streams is set */
   if (priv->session != NULL)
     {
       tpsip_media_session_request_stream_direction (priv->session,
@@ -1801,7 +1803,14 @@ tpsip_media_channel_request_hold (TpSvcChannelInterfaceHold *iface,
 
   priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self);
 
-  if (priv->session != NULL)
+  if (priv->immutable_streams)
+    {
+      GError e = {TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+                  "Session modification disabled"};
+      dbus_g_method_return_error (context, &e);
+      return;
+    }
+  else if (priv->session != NULL)
     {
       tpsip_media_session_request_hold (priv->session, hold);
     }
@@ -1810,6 +1819,7 @@ tpsip_media_channel_request_hold (TpSvcChannelInterfaceHold *iface,
       GError e = {TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
                   "The media session is not available"};
       dbus_g_method_return_error (context, &e);
+      return;
     }
 
   tp_svc_channel_interface_hold_return_from_request_hold (context);
-- 
1.5.6.5




More information about the telepathy-commits mailing list