[Telepathy-commits] [telepathy-gabble/master] Have capabilities announced

Pierre-Luc Beaudoin pierre-luc.beaudoin at collabora.co.uk
Sun Feb 1 05:23:58 PST 2009


---
 src/capabilities.c  |    2 +-
 src/conn-location.c |    9 ++++++---
 src/types.h         |    1 +
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/capabilities.c b/src/capabilities.c
index 0ab45df..e71e278 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -55,7 +55,7 @@ static const Feature self_advertised_features[] =
   { FEATURE_OPTIONAL, NS_OLPC_CURRENT_ACTIVITY "+notify", PRESENCE_CAP_OLPC_1},
   { FEATURE_OPTIONAL, NS_OLPC_ACTIVITY_PROPS "+notify", PRESENCE_CAP_OLPC_1},
 
-  { FEATURE_OPTIONAL, NS_GEOLOC "+notify", 0},
+  { FEATURE_OPTIONAL, NS_GEOLOC "+notify", PRESENCE_CAP_GEOLOCATION},
 
   { 0, NULL, 0}
 };
diff --git a/src/conn-location.c b/src/conn-location.c
index 0638c88..cb134af 100644
--- a/src/conn-location.c
+++ b/src/conn-location.c
@@ -191,6 +191,7 @@ location_get_locations (GabbleSvcConnectionInterfaceLocation *iface,
 
   DEBUG ("GetLocation for contacts:");
 
+  gabble_connection_ensure_capabilities (conn, PRESENCE_CAP_GEOLOCATION);
   if (!validate_contacts (base, context, contacts))
     return;
 
@@ -225,9 +226,10 @@ location_get_locations (GabbleSvcConnectionInterfaceLocation *iface,
 
 }
 
-static void create_msg_foreach (gpointer key,
-                                 gpointer value,
-                                 gpointer user_data)
+static void
+create_msg_foreach (gpointer key,
+                    gpointer value,
+                    gpointer user_data)
 {
   LmMessageNode *geoloc = (LmMessageNode *) user_data;
   gchar *str;
@@ -258,6 +260,7 @@ location_set_location (GabbleSvcConnectionInterfaceLocation *iface,
   LmMessage *msg;
   LmMessageNode *geoloc;
 
+  gabble_connection_ensure_capabilities (conn, PRESENCE_CAP_GEOLOCATION);
   msg = pubsub_make_publish_msg (NULL, NS_GEOLOC, NS_GEOLOC, "geoloc",
       &geoloc);
 
diff --git a/src/types.h b/src/types.h
index 6bfc321..2b0010c 100644
--- a/src/types.h
+++ b/src/types.h
@@ -75,6 +75,7 @@ typedef enum {
     PRESENCE_CAP_JINGLE032 = 1 << 13,
     PRESENCE_CAP_JINGLE_TRANSPORT_ICE = 1 << 14,
     PRESENCE_CAP_JINGLE_TRANSPORT_RAWUDP = 1 << 15,
+    PRESENCE_CAP_GEOLOCATION = 1 << 16,
 } GabblePresenceCapabilities;
 
 G_END_DECLS
-- 
1.5.6.5




More information about the Telepathy-commits mailing list