diff options
author | Florent Le Coz <louiz@louiz.org> | 2012-01-27 18:27:31 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-01-27 18:27:31 +0100 |
commit | dde7875d2cb62500144b5322e7eac216de0b81c6 (patch) | |
tree | 950d1e027a7c7915854feca345d0af1ddb837311 /src | |
parent | e8b0c302fe59b9f1f9ea0b7c6190fb62a62ab010 (diff) | |
parent | d77e79cd6bc98aa588ac7112dada67ad0df74e68 (diff) | |
download | poezio-dde7875d2cb62500144b5322e7eac216de0b81c6.tar.gz poezio-dde7875d2cb62500144b5322e7eac216de0b81c6.tar.bz2 poezio-dde7875d2cb62500144b5322e7eac216de0b81c6.tar.xz poezio-dde7875d2cb62500144b5322e7eac216de0b81c6.zip |
Merge branch 'master' of https://git.louiz.org/poezio
Diffstat (limited to 'src')
-rw-r--r-- | src/connection.py | 2 | ||||
-rw-r--r-- | src/core.py | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/connection.py b/src/connection.py index 352a1d5b..1079b5a6 100644 --- a/src/connection.py +++ b/src/connection.py @@ -42,7 +42,7 @@ class Connection(sleekxmpp.ClientXMPP): password = None sleekxmpp.ClientXMPP.__init__(self, jid, password, ssl=True) self.core = None - self.auto_reconnect = False + self.auto_reconnect = True if config.get('auto_reconnect', 'false').lower() in ('true', '1') else False self.auto_authorize = None self.register_plugin('xep_0030') self.register_plugin('xep_0004') diff --git a/src/core.py b/src/core.py index 2fdc97aa..9b74c1a5 100644 --- a/src/core.py +++ b/src/core.py @@ -768,20 +768,25 @@ class Core(object): """ jid = message['from'] body = xhtml.get_body_from_message_stanza(message) - conversation = self.get_tab_of_conversation_with_jid(jid, create=False) if not body: if message['type'] == 'error': self.information(self.get_error_message_from_error_stanza(message), 'Error') return conversation = self.get_tab_of_conversation_with_jid(jid, create=True) self.events.trigger('conversation_msg', message, conversation) - body = xhtml.get_body_from_message_stanza(message) if roster.get_contact_by_jid(jid.bare): remote_nick = roster.get_contact_by_jid(jid.bare).name or jid.user else: remote_nick = jid.user - conversation._text_buffer.add_message(body, nickname=remote_nick, nick_color=get_theme().COLOR_REMOTE_USER) - if conversation.remote_wants_chatstates is None: + delay_tag = message.find('{urn:xmpp:delay}delay') + if delay_tag is not None: + delayed = True + date = common.datetime_tuple(delay_tag.attrib['stamp']) + else: + delayed = False + date = None + conversation._text_buffer.add_message(body, date, nickname=remote_nick, nick_color=get_theme().COLOR_REMOTE_USER, history=delayed) + if conversation.remote_wants_chatstates is None and not delayed: if message['chat_state']: conversation.remote_wants_chatstates = True else: |