diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-02-24 21:39:49 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-02-24 21:39:49 +0100 |
commit | cccbad13d5dc0515c52131f657e48640aaa7d8af (patch) | |
tree | a9f3e134313e7954a43391be8c4dac03e438923a /src/tabs.py | |
parent | e4b96eb752c5e94b9c0a07232fa8738e14d9a06e (diff) | |
download | poezio-cccbad13d5dc0515c52131f657e48640aaa7d8af.tar.gz poezio-cccbad13d5dc0515c52131f657e48640aaa7d8af.tar.bz2 poezio-cccbad13d5dc0515c52131f657e48640aaa7d8af.tar.xz poezio-cccbad13d5dc0515c52131f657e48640aaa7d8af.zip |
end and handle chatstates in privateconversations
Diffstat (limited to 'src/tabs.py')
-rw-r--r-- | src/tabs.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/tabs.py b/src/tabs.py index 054bdccc..ffae2652 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -376,7 +376,7 @@ class MucTab(ChatTab, TabWithInfoWin): The tab containing a multi-user-chat room. It contains an userlist, an input, a topic, an information and a chat zone """ - message_type = 'chat' + message_type = 'groupchat' def __init__(self, core, room): ChatTab.__init__(self, core, room) TabWithInfoWin.__init__(self) @@ -733,9 +733,14 @@ class PrivateTab(ChatTab, TabWithInfoWin): self.complete_commands(self.input) def command_say(self, line): - muc.send_private_message(self.core.xmpp, self.get_name(), line) - self.core.add_message_to_text_buffer(self.get_room(), line, None, self.get_room().own_nick) - logger.log_message(self.get_name().replace('/', '\\'), self.get_room().own_nick, line) + msg = self.core.xmpp.make_message(self.get_name()) + msg['type'] = 'chat' + msg['body'] = line + if config.get('send_chat_states', 'true') == 'true' and self.remote_wants_chatstates is not False: + msg['chat_state'] = 'active' + msg.send() + self.core.add_message_to_text_buffer(self.get_room(), line, None, self.core.own_nick) + logger.log_message(JID(self.get_name()).bare, self.core.own_nick, line) def command_unquery(self, arg): """ @@ -762,7 +767,7 @@ class PrivateTab(ChatTab, TabWithInfoWin): if self.need_resize: self.resize() self.text_win.refresh(self._room) - self.info_header.refresh(self._room, self.text_win) + self.info_header.refresh(self._room, self.text_win, self.chatstate) self.info_win.refresh(informations) self.tab_win.refresh(tabs, tabs[0]) self.input.refresh() @@ -1330,7 +1335,6 @@ class MucListTab(Tab): Callback called when a disco#items result is received Used with command_list """ - log.debug('res: %s\n\n' % iq) if iq['type'] == 'error': self.set_error(iq['error']['type'], iq['error']['code'], iq['error']['text']) return |