summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-06 15:58:09 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-06 15:58:09 +0100
commita86504868a914eea24e2a28434d965d18c114cf8 (patch)
treeca98291bafa1be02a99aeee3beeabc8679f9a430 /src/core.py
parent1a2d7784fea7bbdd9b30a0a93c1f52c7583468bd (diff)
parent7bf63c51e2650042932ad78207ce5366bab3e38a (diff)
downloadpoezio-a86504868a914eea24e2a28434d965d18c114cf8.tar.gz
poezio-a86504868a914eea24e2a28434d965d18c114cf8.tar.bz2
poezio-a86504868a914eea24e2a28434d965d18c114cf8.tar.xz
poezio-a86504868a914eea24e2a28434d965d18c114cf8.zip
Merge branch 'master' into plugins
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/core.py b/src/core.py
index 9ea53f9b..ac8842e7 100644
--- a/src/core.py
+++ b/src/core.py
@@ -629,6 +629,7 @@ class Core(object):
if conversation is self.current_tab():
self.refresh_window()
else:
+ conversation.state = 'private'
self.refresh_tab_win()
def focus_tab_named(self, tab_name):
@@ -1220,18 +1221,20 @@ class Core(object):
"""
/version <jid>
"""
+ def callback(res):
+ if not res:
+ return self.information('Could not get the software version from %s' % (jid,), 'Warning')
+ version = '%s is running %s version %s on %s' % (jid,
+ res.get('name') or _('an unknown software'),
+ res.get('version') or _('unknown'),
+ res.get('os') or _('on an unknown platform'))
+ self.information(version, 'Info')
+
args = common.shell_split(arg)
if len(args) < 1:
return self.command_help('version')
jid = args[0]
- res = self.xmpp.plugin['xep_0092'].get_version(jid)
- if not res:
- return self.information('Could not get the software version from %s' % (jid,), 'Warning')
- version = '%s is running %s version %s on %s' % (jid,
- res.get('name') or _('an unknown software'),
- res.get('version') or _('unknown'),
- res.get('os') or _('on an unknown platform'))
- self.information(version, 'Info')
+ self.xmpp.plugin['xep_0092'].get_version(jid, callback=callback)
def command_reconnect(self, args):
"""
@@ -1573,14 +1576,15 @@ class Core(object):
self.information_win.refresh()
self.current_tab().input.refresh()
- def disconnect(self, msg=None, reconnect=False):
+ def disconnect(self, msg='', reconnect=False):
"""
Disconnect from remote server and correctly set the states of all
parts of the client (for example, set the MucTabs as not joined, etc)
"""
+ msg = msg or ''
for tab in self.tabs:
- if isinstance(tab, tabs.MucTab):
- muc.leave_groupchat(self.xmpp, tab.name, tab.own_nick, msg)
+ if isinstance(tab, tabs.MucTab) and tab.joined:
+ tab.command_part(msg)
roster.empty()
self.save_config()
# Ugly fix thanks to gmail servers