diff options
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-roster-model-manager.c | 26 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 35 |
2 files changed, 40 insertions, 21 deletions
diff --git a/libempathy-gtk/empathy-roster-model-manager.c b/libempathy-gtk/empathy-roster-model-manager.c index b76a7a384..ed414aa85 100644 --- a/libempathy-gtk/empathy-roster-model-manager.c +++ b/libempathy-gtk/empathy-roster-model-manager.c @@ -55,6 +55,29 @@ struct _EmpathyRosterModelManagerPriv }; static void +members_changed_cb (EmpathyIndividualManager *manager, + const gchar *message, + GList *added, + GList *removed, + TpChannelGroupChangeReason reason, + EmpathyRosterModelManager *self) +{ + GList *l; + + for (l = added; l != NULL; l = g_list_next (l)) + { + empathy_roster_model_fire_individual_added (EMPATHY_ROSTER_MODEL (self), + l->data); + } + + for (l = removed; l != NULL; l = g_list_next (l)) + { + empathy_roster_model_fire_individual_removed (EMPATHY_ROSTER_MODEL (self), + l->data); + } +} + +static void empathy_roster_model_manager_get_property (GObject *object, guint property_id, GValue *value, @@ -104,6 +127,9 @@ empathy_roster_model_manager_constructed (GObject *object) chain_up (object); g_assert (EMPATHY_IS_INDIVIDUAL_MANAGER (self->priv->manager)); + + tp_g_signal_connect_object (self->priv->manager, "members-changed", + G_CALLBACK (members_changed_cb), self, 0); } static void diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index fb157ac90..b54ebc100 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -521,28 +521,19 @@ individual_removed (EmpathyRosterView *self, } static void -members_changed_cb (EmpathyIndividualManager *manager, - const gchar *message, - GList *added, - GList *removed, - TpChannelGroupChangeReason reason, +individual_added_cb (EmpathyRosterModel *model, + FolksIndividual *individual, EmpathyRosterView *self) { - GList *l; - - for (l = added; l != NULL; l = g_list_next (l)) - { - FolksIndividual *individual = l->data; - - individual_added (self, individual); - } - - for (l = removed; l != NULL; l = g_list_next (l)) - { - FolksIndividual *individual = l->data; + individual_added (self, individual); +} - individual_removed (self, individual); - } +static void +individual_removed_cb (EmpathyRosterModel *model, + FolksIndividual *individual, + EmpathyRosterView *self) +{ + individual_removed (self, individual); } static gint @@ -1123,8 +1114,10 @@ empathy_roster_view_constructed (GObject *object) populate_view (self); - tp_g_signal_connect_object (self->priv->manager, "members-changed", - G_CALLBACK (members_changed_cb), self, 0); + tp_g_signal_connect_object (self->priv->model, "individual-added", + G_CALLBACK (individual_added_cb), self, 0); + tp_g_signal_connect_object (self->priv->model, "individual-removed", + G_CALLBACK (individual_removed_cb), self, 0); tp_g_signal_connect_object (self->priv->manager, "groups-changed", G_CALLBACK (groups_changed_cb), self, 0); tp_g_signal_connect_object (self->priv->manager, "notify::top-individuals", |