MUC: Make print_status affect the 333 status code
This commit is contained in:
parent
4f1a3a32c5
commit
b049746418
|
@ -1837,6 +1837,14 @@ class GroupchatControl(ChatControlBase):
|
||||||
simple_jid = app.get_jid_without_resource(obj.real_jid)
|
simple_jid = app.get_jid_without_resource(obj.real_jid)
|
||||||
nick_jid += ' (%s)' % simple_jid
|
nick_jid += ' (%s)' % simple_jid
|
||||||
|
|
||||||
|
con = app.connections[self.account]
|
||||||
|
bookmarks = con.get_module('Bookmarks').bookmarks
|
||||||
|
bookmark = bookmarks.get(self.room_jid, None)
|
||||||
|
if bookmark is None or not bookmark['print_status']:
|
||||||
|
print_status = app.config.get('print_status_in_muc')
|
||||||
|
else:
|
||||||
|
print_status = bookmark['print_status']
|
||||||
|
|
||||||
# status_code
|
# status_code
|
||||||
# http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-\
|
# http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-\
|
||||||
# init
|
# init
|
||||||
|
@ -1884,13 +1892,14 @@ class GroupchatControl(ChatControlBase):
|
||||||
if obj.status_code:
|
if obj.status_code:
|
||||||
if '333' in obj.status_code:
|
if '333' in obj.status_code:
|
||||||
# Handle 333 before 307, some MUCs add both
|
# Handle 333 before 307, some MUCs add both
|
||||||
if obj.nick == self.nick:
|
if print_status != 'none':
|
||||||
s = _('%s kicked us due to an error' % self.room_jid)
|
if obj.nick == self.nick:
|
||||||
else:
|
s = _('%s kicked us due to an error' % self.room_jid)
|
||||||
s = _('%s has left due to an error' % nick)
|
else:
|
||||||
if obj.reason:
|
s = _('%s has left due to an error' % nick)
|
||||||
s += ' (%s)' % obj.reason
|
if obj.reason:
|
||||||
self.print_conversation(s, 'info', graphics=False)
|
s += ' (%s)' % obj.reason
|
||||||
|
self.print_conversation(s, 'info', graphics=False)
|
||||||
elif '307' in obj.status_code:
|
elif '307' in obj.status_code:
|
||||||
if obj.actor is None: # do not print 'kicked by None'
|
if obj.actor is None: # do not print 'kicked by None'
|
||||||
s = _('%(nick)s has been kicked: %(reason)s') % {
|
s = _('%(nick)s has been kicked: %(reason)s') % {
|
||||||
|
@ -2051,13 +2060,6 @@ class GroupchatControl(ChatControlBase):
|
||||||
and (not obj.status_code or '303' not in obj.status_code) and not \
|
and (not obj.status_code or '303' not in obj.status_code) and not \
|
||||||
right_changed:
|
right_changed:
|
||||||
st = ''
|
st = ''
|
||||||
con = app.connections[self.account]
|
|
||||||
bookmarks = con.get_module('Bookmarks').bookmarks
|
|
||||||
bookmark = bookmarks.get(self.room_jid, None)
|
|
||||||
if bookmark is None or not bookmark['print_status']:
|
|
||||||
print_status = app.config.get('print_status_in_muc')
|
|
||||||
else:
|
|
||||||
print_status = bookmark['print_status']
|
|
||||||
|
|
||||||
if obj.show == 'offline':
|
if obj.show == 'offline':
|
||||||
if obj.nick in self.attention_list:
|
if obj.nick in self.attention_list:
|
||||||
|
|
Loading…
Reference in New Issue