[telepathy-gabble/master] Forbid answering calls you've put on hold.

Will Thompson will.thompson at collabora.co.uk
Tue Jun 2 07:10:57 PDT 2009


This is hard to represent at the XMPP level: you can't cancel <ringing/>
without also cancelling <hold/>. It also doesn't really make any sense.

Fixes: fd.o #22031 (although it uses a generic error, rather than a
specific one)
---
 src/media-channel.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/media-channel.c b/src/media-channel.c
index 3248470..9e6de09 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -2121,12 +2121,17 @@ gabble_media_channel_add_member (GObject *obj,
     {
       /* no: has a session been created, is the handle being added ours,
        *     and are we in local pending? (call answer) */
-
       if (priv->session &&
           handle == mixin->self_handle &&
           tp_handle_set_is_member (mixin->local_pending, handle))
         {
-          /* yes: accept the request */
+          /* is the call on hold? */
+          if (priv->hold_state != TP_LOCAL_HOLD_STATE_UNHELD)
+            {
+              g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+                  "Can't answer a call while it's on hold");
+              return FALSE;
+            }
 
           /* make us a member */
           set = tp_intset_new_containing (handle);
-- 
1.5.6.5



More information about the telepathy-commits mailing list