[telepathy-gabble/master] Correct bitwise logic in _resource_has_caps ()

Will Thompson will.thompson at collabora.co.uk
Thu Jun 25 10:57:45 PDT 2009


The existing code returns TRUE if the resource has any of the caps in
question, not all of them. This turns out not to be an issue in any
code that uses this function, because only one cap is ever passed.
---
 src/presence.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/presence.c b/src/presence.c
index 300cbc8..128c593 100644
--- a/src/presence.c
+++ b/src/presence.c
@@ -189,7 +189,7 @@ gabble_presence_resource_has_caps (GabblePresence *presence,
     {
       Resource *res = (Resource *) i->data;
 
-      if (!tp_strdiff (res->name, resource) && (res->caps & caps))
+      if (!tp_strdiff (res->name, resource) && (res->caps & caps) == caps)
         return TRUE;
     }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list