Commit ac3fb695 authored by Maxime Buquet's avatar Maxime Buquet

Merge branch 'muc-barejid-info' into 'master'

poezio.core.handlers: Treat MUC Barejid message as info

See merge request !96
parents 406a10bf 17585c6b
Pipeline #3088 failed with stages
in 5 minutes and 27 seconds
...@@ -778,8 +778,12 @@ class HandlerCore: ...@@ -778,8 +778,12 @@ class HandlerCore:
replaced = True replaced = True
except CorrectionError: except CorrectionError:
log.debug('Unable to correct a message', exc_info=True) log.debug('Unable to correct a message', exc_info=True)
if not replaced and tab.add_message(
PMessage( if not replaced:
# Messages coming from MUC barejid (Server maintenance, IRC mode
# changes from biboumi, etc.) are displayed as info messages.
if message['from'].resource:
ui_msg = PMessage(
txt=body, txt=body,
time=date, time=date,
nickname=nick_from, nickname=nick_from,
...@@ -788,9 +792,18 @@ class HandlerCore: ...@@ -788,9 +792,18 @@ class HandlerCore:
identifier=message['id'], identifier=message['id'],
jid=message['from'], jid=message['from'],
user=user, user=user,
), )
typ=1): typ = 1'highlight', message, tab) else:
ui_msg = InfoMessage(
typ = 2
if tab.add_message(ui_msg, typ):'highlight', message, tab)
if message['from'].resource == tab.own_nick: if message['from'].resource == tab.own_nick:
tab.set_last_sent_message(message, correct=replaced) tab.set_last_sent_message(message, correct=replaced)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment