From 8312d6ee0b44f1fbf7e7bb3825fc5cf0765d26e3 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Wed, 8 Jun 2005 09:45:32 +0000
Subject: [PATCH] we now have "add to roster" in context menu in gc if we have
 the jid of the contact

---
 src/groupchat_window.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/groupchat_window.py b/src/groupchat_window.py
index 7e9da83e76..698554537a 100644
--- a/src/groupchat_window.py
+++ b/src/groupchat_window.py
@@ -485,6 +485,9 @@ def on_info(self, widget, jid):
 			#FIXME: we need the resource but it's not saved
 			#self.plugin.send('ASK_OS_INFO', self.account, jid, resource)
 
+	def on_add_to_roster(self, widget, jid):
+		dialogs.Add_new_contact_window(self.plugin, self.account, jid)
+
 	def on_send_pm(self, widget, model, iter):
 		room_jid = self.get_active_jid()
 		nick = model.get_value(iter, 1)
@@ -549,12 +552,13 @@ def mk_menu(self, room_jid, event, iter):
 			sub_menu.append(item)
 			item.connect('activate', self.revoke_owner, room_jid, jid)
 
-			item = gtk.MenuItem()
-			menu.append(item)
-
 			item = gtk.MenuItem(_('_Information'))
 			menu.append(item)
 			item.connect('activate', self.on_info, jid)
+
+			item = gtk.MenuItem(_('_Add to roster'))
+			menu.append(item)
+			item.connect('activate', self.on_add_to_roster, jid)
 		
 		item = gtk.MenuItem(_('Send _Private Message'))
 		menu.append(item)
-- 
GitLab