aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-28 21:09:26 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-12-14 20:24:04 +0800
commit4db09641569a416334fd5c93d2c6cbc669848806 (patch)
tree23e5176f688bcdeed0cfff5bcf865ee94b568a7c /libempathy-gtk
parenta401d8ed46a4284c140cd44a2cc5cbf53d07e286 (diff)
downloadgsoc2013-empathy-4db09641569a416334fd5c93d2c6cbc669848806.tar
gsoc2013-empathy-4db09641569a416334fd5c93d2c6cbc669848806.tar.gz
gsoc2013-empathy-4db09641569a416334fd5c93d2c6cbc669848806.tar.bz2
gsoc2013-empathy-4db09641569a416334fd5c93d2c6cbc669848806.tar.lz
gsoc2013-empathy-4db09641569a416334fd5c93d2c6cbc669848806.tar.xz
gsoc2013-empathy-4db09641569a416334fd5c93d2c6cbc669848806.tar.zst
gsoc2013-empathy-4db09641569a416334fd5c93d2c6cbc669848806.zip
chat: use an EmpathyIndividualMenu
https://bugzilla.gnome.org/show_bug.cgi?id=665038
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 70e35ddad..1496f582d 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -51,7 +51,6 @@
#include "empathy-contact-dialogs.h"
#include "empathy-individual-store-channel.h"
#include "empathy-individual-view.h"
-#include "empathy-contact-menu.h"
#include "empathy-input-text-view.h"
#include "empathy-search-bar.h"
#include "empathy-theme-manager.h"
@@ -3989,16 +3988,29 @@ empathy_chat_get_contact_menu (EmpathyChat *chat)
{
EmpathyChatPriv *priv = GET_PRIV (chat);
GtkWidget *menu = NULL;
+ FolksIndividual *individual;
+ TpContact *contact;
g_return_val_if_fail (EMPATHY_IS_CHAT (chat), NULL);
- if (priv->remote_contact) {
- menu = empathy_contact_menu_new (priv->remote_contact,
- EMPATHY_CONTACT_FEATURE_CALL |
- EMPATHY_CONTACT_FEATURE_LOG |
- EMPATHY_CONTACT_FEATURE_INFO |
- EMPATHY_CONTACT_FEATURE_BLOCK);
- }
+ if (priv->remote_contact == NULL)
+ return NULL;
+
+ contact = empathy_contact_get_tp_contact (priv->remote_contact);
+ if (contact == NULL)
+ return NULL;
+
+ individual = empathy_create_individual_from_tp_contact (contact);
+ if (individual == NULL)
+ return NULL;
+
+ menu = empathy_individual_menu_new (individual,
+ EMPATHY_INDIVIDUAL_FEATURE_CALL |
+ EMPATHY_INDIVIDUAL_FEATURE_LOG |
+ EMPATHY_INDIVIDUAL_FEATURE_INFO |
+ EMPATHY_INDIVIDUAL_FEATURE_BLOCK, NULL);
+
+ g_object_unref (individual);
return menu;
}