fix the new-subject message and the /part command
This commit is contained in:
parent
f9b386d27f
commit
d502f4a525
2 changed files with 5 additions and 8 deletions
12
src/core.py
12
src/core.py
|
@ -817,10 +817,7 @@ class Core(object):
|
||||||
subject = message['subject']
|
subject = message['subject']
|
||||||
if not subject:
|
if not subject:
|
||||||
return
|
return
|
||||||
if nick_from:
|
self.add_message_to_text_buffer(room, _("%(nick)s set the subject to: %(subject)s") % {'nick':nick_from, 'subject':subject}, time=None)
|
||||||
self.add_message_to_text_buffer(room, _("%(nick)s changed the subject to: %(subject)s") % {'nick':nick_from, 'subject':subject}, time=None)
|
|
||||||
else:
|
|
||||||
self.add_message_to_text_buffer(room, _("The subject is: %(subject)s") % {'subject':subject}, time=None)
|
|
||||||
room.topic = subject.replace('\n', '|')
|
room.topic = subject.replace('\n', '|')
|
||||||
self.refresh_window()
|
self.refresh_window()
|
||||||
|
|
||||||
|
@ -1198,11 +1195,11 @@ class Core(object):
|
||||||
"""
|
"""
|
||||||
/part [msg]
|
/part [msg]
|
||||||
"""
|
"""
|
||||||
args = arg.split()
|
|
||||||
reason = None
|
|
||||||
if not isinstance(self.current_tab(), MucTab) and\
|
if not isinstance(self.current_tab(), MucTab) and\
|
||||||
not isinstance(self.current_tab(), PrivateTab):
|
not isinstance(self.current_tab(), PrivateTab):
|
||||||
return
|
return
|
||||||
|
args = arg.split()
|
||||||
|
reason = None
|
||||||
room = self.current_tab().get_room()
|
room = self.current_tab().get_room()
|
||||||
if len(args):
|
if len(args):
|
||||||
msg = ' '.join(args)
|
msg = ' '.join(args)
|
||||||
|
@ -1211,8 +1208,7 @@ class Core(object):
|
||||||
if isinstance(self.current_tab(), MucTab) and\
|
if isinstance(self.current_tab(), MucTab) and\
|
||||||
self.current_tab().get_room().joined:
|
self.current_tab().get_room().joined:
|
||||||
muc.leave_groupchat(self.xmpp, room.name, room.own_nick, arg)
|
muc.leave_groupchat(self.xmpp, room.name, room.own_nick, arg)
|
||||||
self.tabs.remove(self.current_tab())
|
self.close_tab()
|
||||||
self.refresh_window()
|
|
||||||
|
|
||||||
def close_tab(self, tab=None):
|
def close_tab(self, tab=None):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -481,6 +481,7 @@ class RosterInfoTab(Tab):
|
||||||
self._color_state = theme.COLOR_TAB_NORMAL
|
self._color_state = theme.COLOR_TAB_NORMAL
|
||||||
|
|
||||||
def on_gain_focus(self):
|
def on_gain_focus(self):
|
||||||
|
log.debug('on_gain_focus\n')
|
||||||
self._color_state = theme.COLOR_TAB_CURRENT
|
self._color_state = theme.COLOR_TAB_CURRENT
|
||||||
curses.curs_set(0)
|
curses.curs_set(0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue