mirror of
https://github.com/chatmail/core.git
synced 2026-04-06 07:32:12 +03:00
(jikstra, hpk) fix markseen logic to work like C: ignore if we get no rows for a message (eg desktop calls itwith msg_id=9 which is a special id -- and C just ignored it)
This commit is contained in:
@@ -7,9 +7,9 @@ import re
|
||||
import time
|
||||
from array import array
|
||||
try:
|
||||
from queue import Queue
|
||||
from queue import Queue, Empty
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
from Queue import Queue, Empty
|
||||
|
||||
import deltachat
|
||||
from . import const
|
||||
@@ -439,6 +439,17 @@ class EventLogger:
|
||||
raise ValueError("{}({!r},{!r})".format(*ev))
|
||||
return ev
|
||||
|
||||
def ensure_event_not_queued(self, event_name_regex):
|
||||
__tracebackhide__ = True
|
||||
rex = re.compile("(?:{}).*".format(event_name_regex))
|
||||
while 1:
|
||||
try:
|
||||
ev = self._event_queue.get(False)
|
||||
except Empty:
|
||||
break
|
||||
else:
|
||||
assert not rex.match(ev[0]), "event found {}".format(ev)
|
||||
|
||||
def get_matching(self, event_name_regex, check_error=True):
|
||||
self._log("-- waiting for event with regex: {} --".format(event_name_regex))
|
||||
rex = re.compile("(?:{}).*".format(event_name_regex))
|
||||
|
||||
Reference in New Issue
Block a user