summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-05-14 01:21:59 +0200
committermathieui <mathieui@mathieui.net>2011-05-14 01:21:59 +0200
commitc55f1991438a891208b352a36ea15c2d8dc321c9 (patch)
tree517d64b99883c8581d3146dcd32d7c4fa09b4f68 /src/core.py
parentbf5599d4d01e12659e3d01fc29587d503e66beb0 (diff)
downloadpoezio-c55f1991438a891208b352a36ea15c2d8dc321c9.tar.gz
poezio-c55f1991438a891208b352a36ea15c2d8dc321c9.tar.bz2
poezio-c55f1991438a891208b352a36ea15c2d8dc321c9.tar.xz
poezio-c55f1991438a891208b352a36ea15c2d8dc321c9.zip
fixes #2171, fixes #2173, also set a minimum size (< 5 lines crashes poezio when resizing)
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 7e0fb747..ce95e310 100644
--- a/src/core.py
+++ b/src/core.py
@@ -128,6 +128,7 @@ class Core(object):
'message': (self.command_message, _('Usage: /message <jid> [optional message]\nMessage: Open a conversation with the specified JID (even if it is not in our roster), and send a message to it, if specified'), None),
'version': (self.command_version, _('Usage: /version <jid>\nVersion: get the software version of the given JID (usually its XMPP client and Operating System)'), None),
'connect': (self.command_reconnect, _('Usage: /connect\nConnect: disconnect from the remote server if you are currently connected and then connect to it again'), None),
+ 'server_cycle': (self.command_server_cycle, _('Usage: /server_cycle [domain] [message]\nServer Cycle: disconnect and reconnects in all the rooms in domain.'), None),
}
self.key_func = {
@@ -1327,6 +1328,31 @@ class Core(object):
del tab
self.refresh_window()
+ def command_server_cycle(self, arg):
+ """
+ Do a /cycle on each room of the given server. If none, do it on the current tab
+ """
+ args = common.shell_split(arg)
+ tab = self.current_tab()
+ message = ""
+
+ if len(args):
+ domain = args[0]
+ if len(args) > 1:
+ message = args[1]
+ else:
+ if isinstance(tab, tabs.MucTab):
+ domain = JID(tab.get_name()).domain
+ else:
+ self.information(_("No server specified"), "Error")
+ return
+ for tab in self.tabs:
+ if isinstance(tab, tabs.MucTab) and JID(tab.get_name()).domain == domain:
+ if tab.get_room().joined:
+ muc.leave_groupchat(tab.core.xmpp, tab.get_name(), tab.get_room().own_nick, message)
+ tab.get_room().joined = False
+ self.command_join(tab.get_name())
+
def go_to_room_number(self):
"""
Read 2 more chars and go to the tab