diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2008-07-01 09:56:19 +0000 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2008-08-29 11:04:10 +0200 |
commit | c328d0c67e31fc48fbc38be02b5f6998a5545b34 (patch) | |
tree | 21b26ff2c7664e3927aef105f4e9d5cae786cd17 /src/olpc-view.c | |
parent | 6eab2451cb0ae96afe36990ccf4adac594b44ba5 (diff) |
fire BuddyInfo.ActivitiesChanged when activity views are changed
Diffstat (limited to 'src/olpc-view.c')
-rw-r--r-- | src/olpc-view.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/olpc-view.c b/src/olpc-view.c index 2b8ae1923..fcd313049 100644 --- a/src/olpc-view.c +++ b/src/olpc-view.c @@ -41,6 +41,7 @@ enum { CLOSED, + BUDDY_ACTIVITIES_CHANGED, LAST_SIGNAL }; @@ -313,6 +314,15 @@ gabble_olpc_view_class_init (GabbleOlpcViewClass *gabble_olpc_view_class) NULL, NULL, gabble_marshal_VOID__VOID, G_TYPE_NONE, 0); + + signals[BUDDY_ACTIVITIES_CHANGED] = + g_signal_new ("buddy-activities-changed", + G_OBJECT_CLASS_TYPE (gabble_olpc_view_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + NULL, NULL, + gabble_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); } GabbleOlpcView * @@ -492,7 +502,13 @@ gabble_olpc_view_add_buddies (GabbleOlpcView *self, handle), set); } - tp_handle_set_add (set, room); + if (!tp_handle_set_is_member (set, room)) + { + tp_handle_set_add (set, room); + + g_signal_emit (G_OBJECT (self), + signals[BUDDY_ACTIVITIES_CHANGED], 0, handle); + } } } @@ -604,6 +620,9 @@ remove_activity_foreach_buddy (TpHandle buddy, /* No more activity for this buddy. Remove it */ tp_handle_set_add (ctx->removed, buddy); } + + g_signal_emit (G_OBJECT (ctx->view), signals[BUDDY_ACTIVITIES_CHANGED], + 0, buddy); } } @@ -737,6 +756,9 @@ gabble_olpc_view_buddies_left_activity (GabbleOlpcView *self, /* Remove from the view */ tp_handle_set_add (removed, buddy); } + + g_signal_emit (G_OBJECT (self), signals[BUDDY_ACTIVITIES_CHANGED], + 0, buddy); } } |