From a8a87f51c83c0051fa7bdbbafcd0fab33939263c Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Thu, 21 Oct 2010 19:49:58 +0200
Subject: [PATCH] [Kaini] fix start chat menuitem with zeroconf account

---
 src/roster_window.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/roster_window.py b/src/roster_window.py
index 2f5d9664eb..6feccb3aed 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -4823,12 +4823,15 @@ class RosterWindow:
 
         # items that get shown whether an account is zeroconf or not
         accounts_list = sorted(gajim.contacts.get_accounts())
-        if connected_accounts > 1: # 2 or more accounts? make submenus
+        if connected_accounts > 2 or \
+        (connected_accounts > 1 and not gajim.zeroconf_is_connected()):
+            # 2 or more "real" (no zeroconf) accounts? make submenus
             new_chat_sub_menu = gtk.Menu()
 
             for account in accounts_list:
-                if gajim.connections[account].connected <= 1:
-                    # if offline or connecting
+                if gajim.connections[account].connected <= 1 or \
+                gajim.config.get_per('accounts', account, 'is_zeroconf'):
+                    # if offline or connecting or zeroconf
                     continue
 
                 # new chat
@@ -4956,8 +4959,9 @@ class RosterWindow:
                 for account in gajim.connections:
                     if gajim.account_is_connected(account) and \
                     gajim.connections[account].is_zeroconf:
-                        for item in (join_gc_menuitem, add_new_contact_menuitem,
-                        service_disco_menuitem, single_message_menuitem):
+                        for item in (new_chat_menuitem, join_gc_menuitem,
+                        add_new_contact_menuitem, service_disco_menuitem,
+                        single_message_menuitem):
                             item.set_sensitive(False)
 
         # Manage GC bookmarks
-- 
GitLab