[telepathy-gabble/master] gabble_connection_set_self_capabilities: preserve all "legacy" capabilities

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Aug 24 11:20:24 PDT 2009


This is a stopgap solution to a misfeature of the SetSelfCapabilities
implementation: it assumes that "old-style" Capabilities are preserved.
Previously, this was arranged by not having any unified storage for
draft1 and legacy caps. However, that assumption is about to break.

So, the following policy is now used, which (perhaps by implementation
accident) matches the old behaviour: the new caps are the union of
(the old caps minus all "dynamic" caps) and the caps from channel
managers.

In practice "dynamic caps" means the caps for specific Tube services.
---
 src/connection.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 089e89f..20fdc50 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -2590,7 +2590,8 @@ gabble_connection_set_self_capabilities (
   TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context);
 
   old_caps = gabble_presence_dup_caps (pres);
-  new_caps = gabble_capability_set_new ();
+  new_caps = gabble_capability_set_copy (old_caps);
+  gabble_capability_set_intersect (new_caps, gabble_capabilities_get_legacy ());
 
   for (i = 0; i < caps->len; i++)
     {
-- 
1.5.6.5




More information about the telepathy-commits mailing list