summaryrefslogtreecommitdiff
path: root/telepathy-glib/base-media-call-content.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2012-01-16 11:56:48 +0100
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-01-16 11:56:48 +0100
commit4ed646760253dcc21314d66609ee1c615068d251 (patch)
treef339025b2de4617d0da53c864051d6defa0c1d03 /telepathy-glib/base-media-call-content.c
parent9dc1689db37fd71f5232529172584d87671a7caf (diff)
downloadtelepathy-glib-4ed646760253dcc21314d66609ee1c615068d251.tar.gz
Interfaces property of CallContent is per-object, not per-class
The Audio has DTMF, but video doesn't. The class is the same.
Diffstat (limited to 'telepathy-glib/base-media-call-content.c')
-rw-r--r--telepathy-glib/base-media-call-content.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/telepathy-glib/base-media-call-content.c b/telepathy-glib/base-media-call-content.c
index e5d733975..16014e4c6 100644
--- a/telepathy-glib/base-media-call-content.c
+++ b/telepathy-glib/base-media-call-content.c
@@ -892,6 +892,13 @@ tp_base_media_call_content_start_tone (TpBaseCallContent *bcc,
gchar buf[2] = { 0, 0 };
+ if (tp_base_call_content_get_media_type (bcc) != TP_MEDIA_STREAM_TYPE_AUDIO)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD,
+ "Method does not exist");
+ return FALSE;
+ }
+
if (self->priv->currently_sending_tones != NULL)
{
g_set_error (error, TP_ERRORS, TP_ERROR_SERVICE_BUSY,
@@ -926,6 +933,14 @@ tp_base_media_call_content_stop_tone (TpBaseCallContent *bcc,
{
TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (bcc);
+
+ if (tp_base_call_content_get_media_type (bcc) != TP_MEDIA_STREAM_TYPE_AUDIO)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD,
+ "Method does not exist");
+ return FALSE;
+ }
+
if (self->priv->currently_sending_tones == NULL)
{
g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
@@ -950,6 +965,14 @@ tp_base_media_call_content_multiple_tones (TpBaseCallContent *bcc,
TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (bcc);
guint i;
+
+ if (tp_base_call_content_get_media_type (bcc) != TP_MEDIA_STREAM_TYPE_AUDIO)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD,
+ "Method does not exist");
+ return FALSE;
+ }
+
if (self->priv->currently_sending_tones != NULL)
{
g_set_error (error, TP_ERRORS, TP_ERROR_SERVICE_BUSY,
@@ -1124,7 +1147,9 @@ tp_base_media_call_content_get_interfaces (TpBaseCallContent *bcc)
tp_base_media_call_content_parent_class)->get_interfaces (bcc);
g_ptr_array_add (interfaces, TP_IFACE_CALL_CONTENT_INTERFACE_MEDIA);
- g_ptr_array_add (interfaces, TP_IFACE_CALL_CONTENT_INTERFACE_DTMF);
+
+ if (tp_base_call_content_get_media_type (bcc) == TP_MEDIA_STREAM_TYPE_AUDIO)
+ g_ptr_array_add (interfaces, TP_IFACE_CALL_CONTENT_INTERFACE_DTMF);
return interfaces;
}