[telepathy-gabble/master] Report an error if gabble can't publish location to a non PEP capable server
Pierre-Luc Beaudoin
pierre-luc.beaudoin at collabora.co.uk
Tue May 26 15:57:33 PDT 2009
---
src/conn-location.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/conn-location.c b/src/conn-location.c
index c249bed..ebd98f9 100644
--- a/src/conn-location.c
+++ b/src/conn-location.c
@@ -153,6 +153,15 @@ location_set_location (GabbleSvcConnectionInterfaceLocation *iface,
TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED ((TpBaseConnection *) conn,
context);
+ if (!(conn->features & GABBLE_CONNECTION_FEATURES_PEP))
+ {
+ GError error = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
+ "Server does not support PEP, cannot publish geolocation" };
+
+ dbus_g_method_return_error (context, &error);
+ return;
+ }
+
gabble_connection_ensure_capabilities (conn, PRESENCE_CAP_GEOLOCATION);
msg = pubsub_make_publish_msg (NULL, NS_GEOLOC, NS_GEOLOC, "geoloc",
&geoloc);
--
1.5.6.5
More information about the telepathy-commits
mailing list