Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim

Commits:

1 changed file:

Changes:

  • src/common/logger.py
    ... ... @@ -495,7 +495,8 @@ class Logger:
    495 495
                 all_messages.append(results[0] + (shown,))
    
    496 496
             return all_messages
    
    497 497
     
    
    498
    -    def write(self, kind, jid, message=None, show=None, tim=None, subject=None):
    
    498
    +    def write(self, kind, jid, message=None, show=None, tim=None, subject=None,
    
    499
    +              mam_query=False):
    
    499 500
             """
    
    500 501
             Write a row (status, gcstatus, message etc) to logs database
    
    501 502
     
    
    ... ... @@ -568,7 +569,7 @@ class Logger:
    568 569
                 except exceptions.PysqliteOperationalError, e:
    
    569 570
                     raise exceptions.PysqliteOperationalError(str(e))
    
    570 571
                 if kind == 'chat_msg_recv':
    
    571
    -                if not self.jid_is_from_pm(jid):
    
    572
    +                if not self.jid_is_from_pm(jid) and not mam_query:
    
    572 573
                         # Save in unread table only if it's not a pm
    
    573 574
                         write_unread = True
    
    574 575
     
    
    ... ... @@ -1148,7 +1149,7 @@ class Logger:
    1148 1149
                 log.debug('Log already in DB, ignoring it')
    
    1149 1150
                 return
    
    1150 1151
             log.debug('New log received from server archives, storing it')
    
    1151
    -        self.write(type_, with_, message=msg, tim=tim)
    
    1152
    +        self.write(type_, with_, message=msg, tim=tim, mam_query=True)
    
    1152 1153
     
    
    1153 1154
         def _nec_gc_message_received(self, obj):
    
    1154 1155
             tim_f = float(time.mktime(obj.timestamp))