diff options
author | Davyd Madeley <davyd@madeley.id.au> | 2009-04-24 14:25:27 +0800 |
---|---|---|
committer | Davyd Madeley <davyd@madeley.id.au> | 2009-07-15 18:12:15 +0800 |
commit | 736807e3c658aee559cb3d41413e775023d29c51 (patch) | |
tree | c73bd752b6f1c6158aa513741abb706c25b6b07a /libempathy/empathy-tp-contact-list.c | |
parent | b39c5448563fe1313203884c9da04471817a999e (diff) | |
download | gsoc2013-empathy-736807e3c658aee559cb3d41413e775023d29c51.tar gsoc2013-empathy-736807e3c658aee559cb3d41413e775023d29c51.tar.gz gsoc2013-empathy-736807e3c658aee559cb3d41413e775023d29c51.tar.bz2 gsoc2013-empathy-736807e3c658aee559cb3d41413e775023d29c51.tar.lz gsoc2013-empathy-736807e3c658aee559cb3d41413e775023d29c51.tar.xz gsoc2013-empathy-736807e3c658aee559cb3d41413e775023d29c51.tar.zst gsoc2013-empathy-736807e3c658aee559cb3d41413e775023d29c51.zip |
Expose channel group flags via EmpathyContactList iface
Diffstat (limited to 'libempathy/empathy-tp-contact-list.c')
-rw-r--r-- | libempathy/empathy-tp-contact-list.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index cdb0431c4..4ae5c88c9 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -1074,6 +1074,30 @@ tp_contact_list_remove_group (EmpathyContactList *list, g_array_free (handles, TRUE); } +static EmpathyContactListFlags +tp_contact_list_get_flags (EmpathyContactList *list) +{ + EmpathyTpContactListPriv *priv; + EmpathyContactListFlags flags = 0; + TpChannelGroupFlags group_flags; + + g_return_val_if_fail (EMPATHY_IS_TP_CONTACT_LIST (list), FALSE); + + priv = GET_PRIV (list); + + group_flags = tp_channel_group_get_flags (priv->subscribe); + + if (group_flags & TP_CHANNEL_GROUP_FLAG_CAN_ADD) { + flags |= EMPATHY_CONTACT_LIST_CAN_ADD; + } + + if (group_flags & TP_CHANNEL_GROUP_FLAG_CAN_REMOVE) { + flags |= EMPATHY_CONTACT_LIST_CAN_REMOVE; + } + + return flags; +} + static void tp_contact_list_iface_init (EmpathyContactListIface *iface) { @@ -1087,6 +1111,7 @@ tp_contact_list_iface_init (EmpathyContactListIface *iface) iface->remove_from_group = tp_contact_list_remove_from_group; iface->rename_group = tp_contact_list_rename_group; iface->remove_group = tp_contact_list_remove_group; + iface->get_flags = tp_contact_list_get_flags; } gboolean |