[next] telepathy-gabble: roster: implement new is_blocked() vfunc

Simon McVittie smcv at kemper.freedesktop.org
Mon Jan 13 05:10:37 PST 2014


Module: telepathy-gabble
Branch: next
Commit: e30ab9fde8252730519834488f574ab01741c09e
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=e30ab9fde8252730519834488f574ab01741c09e

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Thu Nov  7 14:16:34 2013 +0000

roster: implement new is_blocked() vfunc

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50093
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>

---

 src/roster.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/roster.c b/src/roster.c
index 50b3454..11adfa5 100644
--- a/src/roster.c
+++ b/src/roster.c
@@ -3014,6 +3014,16 @@ gabble_roster_download_async (TpBaseContactList *base,
   g_clear_error (&error);
 }
 
+static gboolean
+gabble_roster_is_blocked (TpBaseContactList *base,
+    TpHandle contact)
+{
+  GabbleRoster *self = GABBLE_ROSTER (base);
+  GabbleRosterItem *item = _gabble_roster_item_lookup (self, contact);
+
+  return (item != NULL && item->blocked);
+}
+
 static TpHandleSet *
 gabble_roster_dup_blocked_contacts (TpBaseContactList *base)
 {
@@ -3484,6 +3494,7 @@ static void
 blockable_iface_init (TpBlockableContactListInterface *iface)
 {
   iface->can_block = gabble_roster_can_block;
+  iface->is_blocked = gabble_roster_is_blocked;
   iface->dup_blocked_contacts = gabble_roster_dup_blocked_contacts;
   iface->block_contacts_async = gabble_roster_block_contacts_async;
   iface->unblock_contacts_async = gabble_roster_unblock_contacts_async;



More information about the telepathy-commits mailing list