aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-03-22 22:35:34 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-03-22 23:28:05 +0800
commit8e416d8de3b381a7d869e463125fc938d43820bb (patch)
tree34167baa54ce69da4d76e5437ac7f4db61134812
parentba40b4cdae9aae29b6b2e711431e38d63207851c (diff)
downloadgsoc2013-empathy-8e416d8de3b381a7d869e463125fc938d43820bb.tar
gsoc2013-empathy-8e416d8de3b381a7d869e463125fc938d43820bb.tar.gz
gsoc2013-empathy-8e416d8de3b381a7d869e463125fc938d43820bb.tar.bz2
gsoc2013-empathy-8e416d8de3b381a7d869e463125fc938d43820bb.tar.lz
gsoc2013-empathy-8e416d8de3b381a7d869e463125fc938d43820bb.tar.xz
gsoc2013-empathy-8e416d8de3b381a7d869e463125fc938d43820bb.tar.zst
gsoc2013-empathy-8e416d8de3b381a7d869e463125fc938d43820bb.zip
Don't try to block personas that don't support blocking
https://bugzilla.gnome.org/show_bug.cgi?id=645488
-rw-r--r--libempathy/empathy-individual-manager.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 7ae1a9004..8341b697e 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -548,16 +548,23 @@ empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
{
TpfPersona *persona = l->data;
EmpathyContact *contact;
+ EmpathyIndividualManagerFlags flags;
if (!TPF_IS_PERSONA (persona))
continue;
contact = empathy_contact_dup_from_tp_contact (
tpf_persona_get_contact (persona));
- empathy_contact_set_persona (contact, FOLKS_PERSONA (persona));
- empathy_contact_list_set_blocked (
- EMPATHY_CONTACT_LIST (priv->contact_manager),
- contact, blocked, abusive);
+ flags = empathy_individual_manager_get_flags_for_connection (self,
+ empathy_contact_get_connection (contact));
+
+ if (flags & EMPATHY_INDIVIDUAL_MANAGER_CAN_BLOCK)
+ {
+ empathy_contact_set_persona (contact, FOLKS_PERSONA (persona));
+ empathy_contact_list_set_blocked (
+ EMPATHY_CONTACT_LIST (priv->contact_manager),
+ contact, blocked, abusive);
+ }
g_object_unref (contact);
}