diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2010-11-17 15:57:11 -0500 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2010-11-17 16:04:54 -0500 |
commit | ca3b450d1269c3fa1a1254fd25978edd1cfe1c06 (patch) | |
tree | 4ee40950ff9bf04867e18581a00ed4cf91d97105 | |
parent | dfffe650078175f099001f9bc14a3daf0c7e2350 (diff) |
Don't print an error message when optional methods are not implemented
-rw-r--r-- | telepathy-farsight/stream.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/telepathy-farsight/stream.c b/telepathy-farsight/stream.c index 32e9cab..ebb2c01 100644 --- a/telepathy-farsight/stream.c +++ b/telepathy-farsight/stream.c @@ -1043,6 +1043,20 @@ async_method_callback (TpMediaStreamHandler *proxy G_GNUC_UNUSED, } +/* dummy callback handler for async calling calls with no return values + * and whose implementation is optional */ +static void +async_method_callback_optional (TpMediaStreamHandler *proxy G_GNUC_UNUSED, + const GError *error, + gpointer user_data, + GObject *weak_object) +{ + if (error != NULL && + !(error->domain == DBUS_GERROR && + error->code == G_DBUS_ERROR_UNKNOWN_METHOD)) + async_method_callback (proxy, error, user_data, weak_object); +} + static void cb_fs_new_local_candidate (TfStream *self, FsCandidate *candidate) @@ -1874,8 +1888,8 @@ cb_fs_recv_codecs_changed (TfStream *self, tp_cli_media_stream_handler_call_codec_choice (self->priv->stream_handler_proxy, -1, id, - async_method_callback, "Media.StreamHandler::CodecChoice", - NULL, (GObject *) self); + async_method_callback_optional, + "Media.StreamHandler::CodecChoice", NULL, (GObject *) self); } static void @@ -1906,13 +1920,15 @@ cb_fs_new_active_candidate_pair (TfStream *self, tp_cli_media_stream_handler_call_new_active_transport_pair ( self->priv->stream_handler_proxy, -1, local_candidate->foundation, local_transport, remote_candidate->foundation, remote_transport, - async_method_callback, "Media.StreamHandler::NewActiveTransportPair", + async_method_callback_optional, + "Media.StreamHandler::NewActiveTransportPair", NULL, (GObject *) self); tp_cli_media_stream_handler_call_new_active_candidate_pair ( self->priv->stream_handler_proxy, -1, local_candidate->foundation, remote_candidate->foundation, - async_method_callback, "Media.StreamHandler::NewActiveCandidatePair", + async_method_callback_optional, + "Media.StreamHandler::NewActiveCandidatePair", NULL, (GObject *) self); if (self->priv->current_state == TP_MEDIA_STREAM_STATE_DISCONNECTED) |