summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Pessi <Pekka.Pessi@nokia.com>2011-01-10 19:23:38 +0200
committerPekka Pessi <Pekka.Pessi@nokia.com>2011-01-20 15:16:04 +0200
commit8fc49d0c367121d5fbaadbe6126ee37617cfb883 (patch)
treec2cf73fe42a5f726296b7b35d9597d5b6c30314a
parent74d2d6c449d1b95096c8e13c247c0ef65cfefb04 (diff)
Allow requesting with o.f.T.Ch.Interface.SMS.SMSChannel == TRUE.
Note that this feature works with telepathy-glib >= 0.13.10
-rw-r--r--src/ring-text-manager.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ring-text-manager.c b/src/ring-text-manager.c
index 83739ee..798ab8a 100644
--- a/src/ring-text-manager.c
+++ b/src/ring-text-manager.c
@@ -121,6 +121,8 @@ static RingTextChannel *ring_text_manager_request(RingTextManager *self,
gboolean require_mine,
gboolean class0);
+static gboolean tp_asv_get_sms_channel (GHashTable *properties);
+
static void on_text_channel_closed(RingTextChannel *, RingTextManager *);
static void text_channel_removed (gpointer _channel);
@@ -418,6 +420,9 @@ static char const * const ring_text_channel_fixed_properties_list[] =
static char const * const ring_text_channel_allowed_properties[] =
{
TP_IFACE_CHANNEL ".TargetHandle",
+#if HAVE_TP_SMS_CHANNEL
+ TP_IFACE_CHANNEL_INTERFACE_SMS ".SMSChannel",
+#endif
NULL
};
@@ -541,10 +546,27 @@ ring_text_requestotron(RingTextManager *self,
ring_text_channel_allowed_properties))
return FALSE;
+ if (!tp_asv_get_sms_channel (properties))
+ return FALSE;
+
ring_text_manager_request(self, request, initiator, target, require_mine, 0);
return TRUE;
}
+static gboolean tp_asv_get_sms_channel (GHashTable *properties)
+{
+ GValue *value = g_hash_table_lookup (properties,
+ TP_IFACE_CHANNEL_INTERFACE_SMS ".SMSChannel");
+
+ if (value == NULL)
+ return TRUE;
+ else if (!G_VALUE_HOLDS_BOOLEAN (value))
+ return FALSE;
+ else
+ return g_value_get_boolean (value);
+}
+
+
/* ---------------------------------------------------------------------- */
/* RingTextManager interface */