diff options
-rw-r--r-- | libempathy/empathy-tp-roomlist.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libempathy/empathy-tp-roomlist.c b/libempathy/empathy-tp-roomlist.c index 417a287d3..104b8a347 100644 --- a/libempathy/empathy-tp-roomlist.c +++ b/libempathy/empathy-tp-roomlist.c @@ -48,6 +48,7 @@ typedef struct { enum { NEW_ROOM, DESTROY, + ERROR, LAST_SIGNAL }; @@ -239,22 +240,24 @@ tp_roomlist_invalidated_cb (TpChannel *channel, static void call_list_rooms_cb (TpChannel *proxy, const GError *error, - gpointer user_data, + gpointer list, GObject *weak_object) { if (error != NULL) { DEBUG ("Error listing rooms: %s", error->message); + g_signal_emit_by_name (list, "error::start", error); } } static void stop_listing_cb (TpChannel *proxy, const GError *error, - gpointer user_data, + gpointer list, GObject *weak_object) { if (error != NULL) { DEBUG ("Error on stop listing: %s", error->message); + g_signal_emit_by_name (list, "error::stop", error); } } @@ -452,6 +455,16 @@ empathy_tp_roomlist_class_init (EmpathyTpRoomlistClass *klass) G_TYPE_NONE, 0); + signals[ERROR] = + g_signal_new ("error", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, G_TYPE_POINTER); + g_type_class_add_private (object_class, sizeof (EmpathyTpRoomlistPriv)); } @@ -506,7 +519,7 @@ empathy_tp_roomlist_start (EmpathyTpRoomlist *list) g_return_if_fail (EMPATHY_IS_TP_ROOMLIST (list)); if (priv->channel != NULL) { tp_cli_channel_type_room_list_call_list_rooms (priv->channel, -1, - call_list_rooms_cb, NULL, NULL, NULL); + call_list_rooms_cb, list, NULL, NULL); } else { priv->start_requested = TRUE; } @@ -521,6 +534,6 @@ empathy_tp_roomlist_stop (EmpathyTpRoomlist *list) g_return_if_fail (TP_IS_CHANNEL (priv->channel)); tp_cli_channel_type_room_list_call_stop_listing (priv->channel, -1, - stop_listing_cb, NULL, NULL, NULL); + stop_listing_cb, list, NULL, NULL); } |