diff options
author | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-04-11 21:10:56 +0800 |
---|---|---|
committer | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-04-11 21:10:56 +0800 |
commit | 95f04a4159eb90f55c23b9a51f925101e3241d03 (patch) | |
tree | ad4bbd5329c1278cba690872b963a0114b355330 /libempathy | |
parent | b77311c355b5edd4aa853fa30b14d592968d0aed (diff) | |
download | gsoc2013-empathy-95f04a4159eb90f55c23b9a51f925101e3241d03.tar gsoc2013-empathy-95f04a4159eb90f55c23b9a51f925101e3241d03.tar.gz gsoc2013-empathy-95f04a4159eb90f55c23b9a51f925101e3241d03.tar.bz2 gsoc2013-empathy-95f04a4159eb90f55c23b9a51f925101e3241d03.tar.lz gsoc2013-empathy-95f04a4159eb90f55c23b9a51f925101e3241d03.tar.xz gsoc2013-empathy-95f04a4159eb90f55c23b9a51f925101e3241d03.tar.zst gsoc2013-empathy-95f04a4159eb90f55c23b9a51f925101e3241d03.zip |
Add empathy_tp_group_get_invitation
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@903 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-tp-group.c | 34 | ||||
-rw-r--r-- | libempathy/empathy-tp-group.h | 2 |
2 files changed, 36 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-group.c b/libempathy/empathy-tp-group.c index 0558bcb28..ef6697de4 100644 --- a/libempathy/empathy-tp-group.c +++ b/libempathy/empathy-tp-group.c @@ -954,4 +954,38 @@ empathy_tp_group_is_ready (EmpathyTpGroup *group) return priv->ready; } +EmpathyPendingInfo * +empathy_tp_group_get_invitation (EmpathyTpGroup *group, + EmpathyContact **remote_contact) +{ + EmpathyTpGroupPriv *priv = GET_PRIV (group); + EmpathyContact *contact = NULL; + EmpathyPendingInfo *invitation = NULL; + GList *l; + + g_return_val_if_fail (EMPATHY_IS_TP_GROUP (group), FALSE); + g_return_val_if_fail (priv->ready, NULL); + + for (l = priv->local_pendings; l; l = l->next) { + EmpathyPendingInfo *info = l->data; + + if (empathy_contact_is_user (info->member)) { + invitation = info; + break; + } + } + + if (invitation && priv->members && !priv->members->next) { + contact = priv->members->data; + } + if (!invitation && priv->remote_pendings && !priv->remote_pendings->next) { + contact = priv->remote_pendings->data; + } + + if (remote_contact) { + *remote_contact = contact; + } + + return invitation; +} diff --git a/libempathy/empathy-tp-group.h b/libempathy/empathy-tp-group.h index 9309c94af..63473b48e 100644 --- a/libempathy/empathy-tp-group.h +++ b/libempathy/empathy-tp-group.h @@ -81,6 +81,8 @@ EmpathyContact * empathy_tp_group_get_self_contact (EmpathyTpGroup *gr gboolean empathy_tp_group_is_member (EmpathyTpGroup *group, EmpathyContact *contact); gboolean empathy_tp_group_is_ready (EmpathyTpGroup *group); +EmpathyPendingInfo *empathy_tp_group_get_invitation (EmpathyTpGroup *group, + EmpathyContact **remote_contact); EmpathyPendingInfo *empathy_pending_info_new (EmpathyContact *member, EmpathyContact *actor, const gchar *message); |