From a9f0607123798fa6ad990b322e90178ea4101fd8 Mon Sep 17 00:00:00 2001
From: mathieui <mathieui@mathieui.net>
Date: Thu, 20 Feb 2014 08:39:40 +0100
Subject: Fix #2470 (server_cycle joining the wrong room with domain-only muc)

---
 src/core.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/core.py b/src/core.py
index ed78e6a3..f9c6d5e3 100644
--- a/src/core.py
+++ b/src/core.py
@@ -2284,7 +2284,10 @@ class Core(object):
                 if tab.joined:
                     muc.leave_groupchat(tab.core.xmpp, tab.get_name(), tab.own_nick, message)
                 tab.joined = False
-                self.command_join('"%s/%s"' %(tab.get_name(), tab.own_nick))
+                if tab.get_name() == domain:
+                    self.command_join('"@%s/%s"' %(tab.get_name(), tab.own_nick))
+                else:
+                    self.command_join('"%s/%s"' %(tab.get_name(), tab.own_nick))
 
     def completion_server_cycle(self, the_input):
         """Completion for /server_cycle"""
-- 
cgit v1.2.3