diff options
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-roster-model-manager.c | 15 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-model.c | 20 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-model.h | 5 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 6 |
4 files changed, 43 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-roster-model-manager.c b/libempathy-gtk/empathy-roster-model-manager.c index ed414aa85..2684d2765 100644 --- a/libempathy-gtk/empathy-roster-model-manager.c +++ b/libempathy-gtk/empathy-roster-model-manager.c @@ -78,6 +78,19 @@ members_changed_cb (EmpathyIndividualManager *manager, } static void +groups_changed_cb (EmpathyIndividualManager *manager, + FolksIndividual *individual, + const gchar *group, + gboolean is_member, + EmpathyRosterModelManager *self) +{ + empathy_roster_model_fire_groups_changed (EMPATHY_ROSTER_MODEL (self), + individual, + group, + is_member); +} + +static void empathy_roster_model_manager_get_property (GObject *object, guint property_id, GValue *value, @@ -130,6 +143,8 @@ empathy_roster_model_manager_constructed (GObject *object) tp_g_signal_connect_object (self->priv->manager, "members-changed", G_CALLBACK (members_changed_cb), self, 0); + tp_g_signal_connect_object (self->priv->manager, "groups-changed", + G_CALLBACK (groups_changed_cb), self, 0); } static void diff --git a/libempathy-gtk/empathy-roster-model.c b/libempathy-gtk/empathy-roster-model.c index ce86e58a6..eaceca5f7 100644 --- a/libempathy-gtk/empathy-roster-model.c +++ b/libempathy-gtk/empathy-roster-model.c @@ -27,6 +27,7 @@ enum { SIG_INDIVIDUAL_ADDED, SIG_INDIVIDUAL_REMOVED, + SIG_GROUPS_CHANGED, LAST_SIGNAL }; @@ -50,6 +51,16 @@ empathy_roster_model_default_init (EmpathyRosterModelInterface *iface) 0, NULL, NULL, NULL, G_TYPE_NONE, 1, FOLKS_TYPE_INDIVIDUAL); + + signals[SIG_GROUPS_CHANGED] = + g_signal_new ("groups-changed", + EMPATHY_TYPE_ROSTER_MODEL, + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 3, + FOLKS_TYPE_INDIVIDUAL, + G_TYPE_STRING, + G_TYPE_BOOLEAN); } /***** Restricted *****/ @@ -68,6 +79,15 @@ empathy_roster_model_fire_individual_removed (EmpathyRosterModel *self, g_signal_emit (self, signals[SIG_INDIVIDUAL_REMOVED], 0, individual); } +void +empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self, + FolksIndividual *individual, + const gchar *group, + gboolean is_member) +{ + g_signal_emit (self, signals[SIG_GROUPS_CHANGED], 0, individual, group, is_member); +} + /***** Public *****/ GList * diff --git a/libempathy-gtk/empathy-roster-model.h b/libempathy-gtk/empathy-roster-model.h index e6c382825..59db96f0c 100644 --- a/libempathy-gtk/empathy-roster-model.h +++ b/libempathy-gtk/empathy-roster-model.h @@ -63,6 +63,11 @@ void empathy_roster_model_fire_individual_added (EmpathyRosterModel *self, void empathy_roster_model_fire_individual_removed (EmpathyRosterModel *self, FolksIndividual *individual); +void empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self, + FolksIndividual *individual, + const gchar *group, + gboolean is_member); + /* Public API */ GList * empathy_roster_model_get_individuals (EmpathyRosterModel *self); diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index 90d7296eb..b07a4b252 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -1040,9 +1040,9 @@ update_top_contacts (EmpathyRosterView *self) } static void -groups_changed_cb (EmpathyIndividualManager *manager, +groups_changed_cb (EmpathyRosterModel *model, FolksIndividual *individual, - gchar *group, + const gchar *group, gboolean is_member, EmpathyRosterView *self) { @@ -1118,7 +1118,7 @@ empathy_roster_view_constructed (GObject *object) 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", + tp_g_signal_connect_object (self->priv->model, "groups-changed", G_CALLBACK (groups_changed_cb), self, 0); tp_g_signal_connect_object (self->priv->manager, "notify::top-individuals", G_CALLBACK (top_individuals_changed_cb), self, 0); |