Philipp Hörist pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/groupchat_control.py
    ... ... @@ -1837,6 +1837,14 @@ class GroupchatControl(ChatControlBase):
    1837 1837
                 simple_jid = app.get_jid_without_resource(obj.real_jid)
    
    1838 1838
                 nick_jid += ' (%s)' % simple_jid
    
    1839 1839
     
    
    1840
    +        con = app.connections[self.account]
    
    1841
    +        bookmarks = con.get_module('Bookmarks').bookmarks
    
    1842
    +        bookmark = bookmarks.get(self.room_jid, None)
    
    1843
    +        if bookmark is None or not bookmark['print_status']:
    
    1844
    +            print_status = app.config.get('print_status_in_muc')
    
    1845
    +        else:
    
    1846
    +            print_status = bookmark['print_status']
    
    1847
    +
    
    1840 1848
             # status_code
    
    1841 1849
             # http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-\
    
    1842 1850
             # init
    
    ... ... @@ -1884,13 +1892,14 @@ class GroupchatControl(ChatControlBase):
    1884 1892
                 if obj.status_code:
    
    1885 1893
                     if '333' in obj.status_code:
    
    1886 1894
                         # Handle 333 before 307, some MUCs add both
    
    1887
    -                    if obj.nick == self.nick:
    
    1888
    -                        s = _('%s kicked us due to an error' % self.room_jid)
    
    1889
    -                    else:
    
    1890
    -                        s = _('%s has left due to an error' % nick)
    
    1891
    -                    if obj.reason:
    
    1892
    -                        s += ' (%s)' % obj.reason
    
    1893
    -                    self.print_conversation(s, 'info', graphics=False)
    
    1895
    +                    if print_status != 'none':
    
    1896
    +                        if obj.nick == self.nick:
    
    1897
    +                            s = _('%s kicked us due to an error' % self.room_jid)
    
    1898
    +                        else:
    
    1899
    +                            s = _('%s has left due to an error' % nick)
    
    1900
    +                        if obj.reason:
    
    1901
    +                            s += ' (%s)' % obj.reason
    
    1902
    +                        self.print_conversation(s, 'info', graphics=False)
    
    1894 1903
                     elif '307' in obj.status_code:
    
    1895 1904
                         if obj.actor is None: # do not print 'kicked by None'
    
    1896 1905
                             s = _('%(nick)s has been kicked: %(reason)s') % {
    
    ... ... @@ -2051,13 +2060,6 @@ class GroupchatControl(ChatControlBase):
    2051 2060
             and (not obj.status_code or '303' not in obj.status_code) and not \
    
    2052 2061
             right_changed:
    
    2053 2062
                 st = ''
    
    2054
    -            con = app.connections[self.account]
    
    2055
    -            bookmarks = con.get_module('Bookmarks').bookmarks
    
    2056
    -            bookmark = bookmarks.get(self.room_jid, None)
    
    2057
    -            if bookmark is None or not bookmark['print_status']:
    
    2058
    -                print_status = app.config.get('print_status_in_muc')
    
    2059
    -            else:
    
    2060
    -                print_status = bookmark['print_status']
    
    2061 2063
     
    
    2062 2064
                 if obj.show == 'offline':
    
    2063 2065
                     if obj.nick in self.attention_list: