diff options
author | Travis Reitter <treitter@gmail.com> | 2010-07-13 08:12:14 +0800 |
---|---|---|
committer | Travis Reitter <treitter@gmail.com> | 2010-07-21 07:12:37 +0800 |
commit | e135f5a5112058e61bb20357f34f69e63a4cc942 (patch) | |
tree | 04ec078f51efa7985d8f5e5931af3f38e9691d53 | |
parent | faa4b2c9106b84c7c083c9ef2763dbd0e6892998 (diff) | |
download | gsoc2013-empathy-e135f5a5112058e61bb20357f34f69e63a4cc942.tar gsoc2013-empathy-e135f5a5112058e61bb20357f34f69e63a4cc942.tar.gz gsoc2013-empathy-e135f5a5112058e61bb20357f34f69e63a4cc942.tar.bz2 gsoc2013-empathy-e135f5a5112058e61bb20357f34f69e63a4cc942.tar.lz gsoc2013-empathy-e135f5a5112058e61bb20357f34f69e63a4cc942.tar.xz gsoc2013-empathy-e135f5a5112058e61bb20357f34f69e63a4cc942.tar.zst gsoc2013-empathy-e135f5a5112058e61bb20357f34f69e63a4cc942.zip |
Update to the FolksIndividualAggregator:individuals-changed signal.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | libempathy/empathy-individual-manager.c | 37 | ||||
-rw-r--r-- | libempathy/empathy-utils.c | 7 | ||||
-rw-r--r-- | libempathy/empathy-utils.h | 1 |
4 files changed, 23 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index c23aaab88..3563e6d9c 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_COPYRIGHT([ # Minimal version required # Hardp deps -FOLKS_REQUIRED=0.1.7 +FOLKS_REQUIRED=0.1.8 GCONF_REQUIRED=1.2.0 GLIB_REQUIRED=2.25.9 GTK_REQUIRED=2.21.2 diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c index 9f260cb27..58a020bb6 100644 --- a/libempathy/empathy-individual-manager.c +++ b/libempathy/empathy-individual-manager.c @@ -92,13 +92,17 @@ individual_notify_is_favourite_cb (FolksIndividual *individual, } static void -aggregator_individuals_added_cb (FolksIndividualAggregator *aggregator, - GList *individuals, +aggregator_individuals_changed_cb (FolksIndividualAggregator *aggregator, + GList *added, + GList *removed, + const char *message, + FolksPersona *actor, + guint reason, EmpathyIndividualManager *self) { GList *l; - for (l = individuals; l; l = l->next) + for (l = added; l; l = l->next) { g_signal_connect (l->data, "group-changed", G_CALLBACK (individual_group_changed_cb), self); @@ -106,19 +110,7 @@ aggregator_individuals_added_cb (FolksIndividualAggregator *aggregator, G_CALLBACK (individual_notify_is_favourite_cb), self); } - /* TODO: don't hard-code the reason or message */ - g_signal_emit (self, signals[MEMBERS_CHANGED], 0, "individual(s) added", - individuals, NULL, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, TRUE); -} - -static void -aggregator_individuals_removed_cb (FolksIndividualAggregator *aggregator, - GList *individuals, - EmpathyIndividualManager *self) -{ - GList *l; - - for (l = individuals; l; l = l->next) + for (l = removed; l; l = l->next) { g_signal_handlers_disconnect_by_func (l->data, individual_group_changed_cb, self); @@ -126,9 +118,10 @@ aggregator_individuals_removed_cb (FolksIndividualAggregator *aggregator, individual_notify_is_favourite_cb, self); } - /* TODO: don't hard-code the reason or message */ - g_signal_emit (self, signals[MEMBERS_CHANGED], 0, "individual(s) removed", - NULL, individuals, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, TRUE); + g_signal_emit (self, signals[MEMBERS_CHANGED], 0, message, + added, removed, + tp_chanel_group_change_reason_from_folks_groups_change_reason (reason), + TRUE); } static void @@ -233,10 +226,8 @@ empathy_individual_manager_init (EmpathyIndividualManager *self) priv->contact_manager = empathy_contact_manager_dup_singleton (); priv->aggregator = folks_individual_aggregator_new (); - g_signal_connect (priv->aggregator, "individuals-added", - G_CALLBACK (aggregator_individuals_added_cb), self); - g_signal_connect (priv->aggregator, "individuals-removed", - G_CALLBACK (aggregator_individuals_removed_cb), self); + g_signal_connect (priv->aggregator, "individuals-changed", + G_CALLBACK (aggregator_individuals_changed_cb), self); } EmpathyIndividualManager * diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index e15dcc8c4..d460f5582 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -652,3 +652,10 @@ folks_individual_dup_from_empathy_contact (EmpathyContact *contact) return individual; } + +TpChannelGroupChangeReason +tp_chanel_group_change_reason_from_folks_groups_change_reason ( + FolksGroupsChangeReason reason) +{ + return (TpChannelGroupChangeReason) reason; +} diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 3168d1516..f35d9e5c3 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -94,6 +94,7 @@ TpConnectionPresenceType empathy_folks_presence_type_to_tp (FolksPresenceType ty gboolean empathy_folks_individual_contains_contact (FolksIndividual *individual); EmpathyContact * empathy_contact_dup_from_folks_individual (FolksIndividual *individual); FolksIndividual *folks_individual_dup_from_empathy_contact (EmpathyContact *contact); +TpChannelGroupChangeReason tp_chanel_group_change_reason_from_folks_groups_change_reason (FolksGroupsChangeReason reason); G_END_DECLS |