[telepathy-gabble/master] Only send <hold/> if the peer thinks they're unheld

Will Thompson will.thompson at collabora.co.uk
Tue Mar 31 05:00:42 PDT 2009


We send <hold/> immediately we move to PendingHold, because we don't
expect holding to fail. We send <unhold/> only when we actually get back
to Unheld, because reacquiring the audio device etc. might fail.

If RequestHold(False) is called, and then before tpfs reacquires the
devices RequestHold(True) is called, we haven't yet informed the other
end that they're unheld, so we shouldn't send another <hold/>.
---
 src/media-channel.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/media-channel.c b/src/media-channel.c
index f4e931d..153d921 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -2792,7 +2792,10 @@ gabble_media_channel_request_hold (TpSvcChannelInterfaceHold *iface,
           return;
         }
 
-      inform_peer_of_hold (self);
+      if (priv->hold_state == TP_LOCAL_HOLD_STATE_UNHELD)
+        {
+          inform_peer_of_hold (self);
+        }
 
       priv->hold_state = TP_LOCAL_HOLD_STATE_PENDING_HOLD;
     }
-- 
1.5.6.5




More information about the telepathy-commits mailing list