[Telepathy-commits] [telepathy-gabble/master] added helper function to determine whether there are pending disco request for caps for some handle
Senko Rasic
senko.rasic at collabora.co.uk
Thu Dec 4 06:09:05 PST 2008
---
src/presence-cache.c | 29 +++++++++++++++++++++++++++++
src/presence-cache.h | 3 +++
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/presence-cache.c b/src/presence-cache.c
index b5018cc..9bc7187 100644
--- a/src/presence-cache.c
+++ b/src/presence-cache.c
@@ -1560,3 +1560,32 @@ gabble_presence_cache_contacts_removed_from_olpc_view (
g_array_free (tmp, TRUE);
g_array_free (changed, TRUE);
}
+
+gboolean
+gabble_presence_cache_caps_pending (GabblePresenceCache *cache,
+ TpHandle handle)
+{
+ GabblePresenceCachePrivate *priv = GABBLE_PRESENCE_CACHE_PRIV (cache);
+ GList *uris, *li;
+
+ uris = g_hash_table_get_values (priv->disco_pending);
+
+ for (li = uris; li != NULL; li = li->next)
+ {
+ GSList *waiters;
+
+ for (waiters = li->data; waiters != NULL; waiters = waiters->next)
+ {
+ DiscoWaiter *w = waiters->data;
+ if (w->handle == handle)
+ {
+ g_list_free (uris);
+ return TRUE;
+ }
+
+ }
+ }
+
+ return FALSE;
+}
+
diff --git a/src/presence-cache.h b/src/presence-cache.h
index 9c0cd1e..dbfaccf 100644
--- a/src/presence-cache.h
+++ b/src/presence-cache.h
@@ -91,6 +91,9 @@ void gabble_presence_cache_contacts_added_to_olpc_view (
void gabble_presence_cache_contacts_removed_from_olpc_view (
GabblePresenceCache *cache, TpHandleSet *handles);
+gboolean gabble_presence_cache_caps_pending (GabblePresenceCache *cache,
+ TpHandle handle);
+
G_END_DECLS
#endif /* __GABBLE_PRESENCE_CACHE_H__ */
--
1.5.6.5
More information about the Telepathy-commits
mailing list