Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim
Commits: 09542bd0 by Philipp Hörist at 2017-03-13T23:28:55+01:00 Dont treat MAM results as unread messages
Fixes #8544
- - - - -
1 changed file:
- src/common/logger.py
Changes:
===================================== src/common/logger.py ===================================== --- a/src/common/logger.py +++ b/src/common/logger.py @@ -495,7 +495,8 @@ class Logger: all_messages.append(results[0] + (shown,)) return all_messages
- def write(self, kind, jid, message=None, show=None, tim=None, subject=None): + def write(self, kind, jid, message=None, show=None, tim=None, subject=None, + mam_query=False): """ Write a row (status, gcstatus, message etc) to logs database
@@ -568,7 +569,7 @@ class Logger: except exceptions.PysqliteOperationalError, e: raise exceptions.PysqliteOperationalError(str(e)) if kind == 'chat_msg_recv': - if not self.jid_is_from_pm(jid): + if not self.jid_is_from_pm(jid) and not mam_query: # Save in unread table only if it's not a pm write_unread = True
@@ -1148,7 +1149,7 @@ class Logger: log.debug('Log already in DB, ignoring it') return log.debug('New log received from server archives, storing it') - self.write(type_, with_, message=msg, tim=tim) + self.write(type_, with_, message=msg, tim=tim, mam_query=True)
def _nec_gc_message_received(self, obj): tim_f = float(time.mktime(obj.timestamp))
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/09542bd0b017926bd5f9c7dae92617c34eb...