[telepathy-gabble/master] GabbleCapsChannelManager: add represent_client method
Simon McVittie
simon.mcvittie at collabora.co.uk
Thu Sep 10 04:40:01 PDT 2009
This will be the basis for ContactCapabilities draft 2.
---
src/caps-channel-manager.c | 32 ++++++++++++++++++++++++++++++++
src/caps-channel-manager.h | 15 +++++++++++++++
2 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/src/caps-channel-manager.c b/src/caps-channel-manager.c
index e2182c2..545bee1 100644
--- a/src/caps-channel-manager.c
+++ b/src/caps-channel-manager.c
@@ -104,3 +104,35 @@ gabble_caps_channel_manager_add_capability (
/* ... else, nothing to do */
}
+/**
+ * gabble_caps_channel_manager_represent_client:
+ * @self: a channel manager
+ * @client_name: the name of the client, for any debug messages
+ * @filters: the channel classes accepted by the client, as an array of
+ * GHashTable with string keys and GValue values
+ * @cap_tokens: the handler capability tokens supported by the client
+ * @cap_set: a set into which to merge additional XMPP capabilities
+ *
+ * Convert the capabilities of a Telepathy client into XMPP capabilities to be
+ * advertised.
+ *
+ * (The actual XMPP capabilities advertised will be the union of the XMPP
+ * capabilities of every installed client.)
+ */
+void
+gabble_caps_channel_manager_represent_client (
+ GabbleCapsChannelManager *caps_manager,
+ const gchar *client_name,
+ const GPtrArray *filters,
+ const gchar * const *cap_tokens,
+ GabbleCapabilitySet *cap_set)
+{
+ GabbleCapsChannelManagerIface *iface =
+ GABBLE_CAPS_CHANNEL_MANAGER_GET_INTERFACE (caps_manager);
+ GabbleCapsChannelManagerRepresentClientFunc method = iface->represent_client;
+
+ if (method != NULL)
+ {
+ method (caps_manager, client_name, filters, cap_tokens, cap_set);
+ }
+}
diff --git a/src/caps-channel-manager.h b/src/caps-channel-manager.h
index dd04155..b4e5733 100644
--- a/src/caps-channel-manager.h
+++ b/src/caps-channel-manager.h
@@ -65,6 +65,13 @@ typedef void (*GabbleCapsChannelManagerAddCapFunc) (
GHashTable *cap,
GabbleCapabilitySet *cap_set);
+typedef void (*GabbleCapsChannelManagerRepresentClientFunc) (
+ GabbleCapsChannelManager *manager,
+ const gchar *client_name,
+ const GPtrArray *filters,
+ const gchar * const *cap_tokens,
+ GabbleCapabilitySet *cap_set);
+
void gabble_caps_channel_manager_get_contact_capabilities (
GabbleCapsChannelManager *caps_manager,
TpHandle handle,
@@ -76,11 +83,19 @@ void gabble_caps_channel_manager_add_capability (
GHashTable *cap,
GabbleCapabilitySet *cap_set);
+void gabble_caps_channel_manager_represent_client (
+ GabbleCapsChannelManager *caps_manager,
+ const gchar *client_name,
+ const GPtrArray *filters,
+ const gchar * const *cap_tokens,
+ GabbleCapabilitySet *cap_set);
+
struct _GabbleCapsChannelManagerIface {
GTypeInterface parent;
GabbleCapsChannelManagerGetContactCapsFunc get_contact_caps;
GabbleCapsChannelManagerAddCapFunc add_cap;
+ GabbleCapsChannelManagerRepresentClientFunc represent_client;
GCallback _future[8];
gpointer priv;
--
1.5.6.5
More information about the telepathy-commits
mailing list