aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-03-22 23:25:26 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-03-22 23:25:56 +0800
commite68f14484d688716bb3d09fbc9ee4fa5ad17db9e (patch)
treedfc28503e1eabdf2d378c52e83f80c914fbda7a3 /libempathy
parent6c943efd9aabd9d0d8674c3c58d2e58efdb412f6 (diff)
downloadgsoc2013-empathy-e68f14484d688716bb3d09fbc9ee4fa5ad17db9e.tar
gsoc2013-empathy-e68f14484d688716bb3d09fbc9ee4fa5ad17db9e.tar.gz
gsoc2013-empathy-e68f14484d688716bb3d09fbc9ee4fa5ad17db9e.tar.bz2
gsoc2013-empathy-e68f14484d688716bb3d09fbc9ee4fa5ad17db9e.tar.lz
gsoc2013-empathy-e68f14484d688716bb3d09fbc9ee4fa5ad17db9e.tar.xz
gsoc2013-empathy-e68f14484d688716bb3d09fbc9ee4fa5ad17db9e.tar.zst
gsoc2013-empathy-e68f14484d688716bb3d09fbc9ee4fa5ad17db9e.zip
Don't try to block personas that don't support blocking
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-individual-manager.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index bbd511558..088c67fd8 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -545,6 +545,7 @@ empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
TpfPersona *persona = l->data;
EmpathyContact *contact;
EmpathyContactManager *manager;
+ EmpathyContactListFlags flags;
if (!TPF_IS_PERSONA (persona))
continue;
@@ -553,9 +554,13 @@ empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
tpf_persona_get_contact (persona));
empathy_contact_set_persona (contact, FOLKS_PERSONA (persona));
manager = empathy_contact_manager_dup_singleton ();
- empathy_contact_list_set_blocked (
- EMPATHY_CONTACT_LIST (manager),
- contact, blocked, abusive);
+ flags = empathy_contact_manager_get_flags_for_connection (manager,
+ empathy_contact_get_connection (contact));
+
+ if (flags & EMPATHY_CONTACT_LIST_CAN_BLOCK)
+ empathy_contact_list_set_blocked (
+ EMPATHY_CONTACT_LIST (manager),
+ contact, blocked, abusive);
g_object_unref (manager);
g_object_unref (contact);