[Telepathy-commits] [telepathy-glib/master] ExampleCallableMediaManager: don't allow calling yourself
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Mar 10 09:25:38 PDT 2009
---
examples/cm/callable/media-manager.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/examples/cm/callable/media-manager.c b/examples/cm/callable/media-manager.c
index 0d3adb6..97fb04a 100644
--- a/examples/cm/callable/media-manager.c
+++ b/examples/cm/callable/media-manager.c
@@ -331,6 +331,19 @@ example_callable_media_manager_request (ExampleCallableMediaManager *self,
goto error;
}
+ if (handle == self->priv->conn->self_handle)
+ {
+ /* In protocols with a concept of multiple "resources" signed in to
+ * one account (XMPP, and possibly MSN) it is technically possible to
+ * call yourself - e.g. if you're signed in on two PCs, you can call one
+ * from the other. For simplicity, this example simulates a protocol
+ * where this is not the case.
+ */
+ g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
+ "In this protocol, you can't call yourself");
+ goto error;
+ }
+
if (!require_new)
{
/* see if we're already calling that handle */
--
1.5.6.5
More information about the telepathy-commits
mailing list