Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gajim/common/modules/chat_markers.py')
-rw-r--r--gajim/common/modules/chat_markers.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/gajim/common/modules/chat_markers.py b/gajim/common/modules/chat_markers.py
index a574df3d0..9d84225de 100644
--- a/gajim/common/modules/chat_markers.py
+++ b/gajim/common/modules/chat_markers.py
@@ -29,6 +29,7 @@ from gajim.common.events import ReadStateSync
from gajim.common.modules.base import BaseModule
from gajim.common.modules.contacts import BareContact
from gajim.common.modules.contacts import GroupchatContact
+from gajim.common.storage.archive.structs import DbUpsertMarkerRowData
from gajim.common.structs import OutgoingMessage
@@ -96,19 +97,23 @@ class ChatMarkers(BaseModule):
properties.jid,
properties.marker.id)
- jid = properties.jid
if not properties.is_muc_pm and not properties.type.is_groupchat:
- jid = properties.jid.bare
-
- app.storage.archive.set_marker(
- app.get_jid_from_account(self._account),
- jid,
- properties.marker.id,
- 'displayed')
+ if properties.is_mam_message:
+ timestamp = properties.mam.timestamp
+ else:
+ timestamp = properties.timestamp
+
+ marker_data = DbUpsertMarkerRowData(
+ account=self._account,
+ remote_jid=properties.remote_jid,
+ fk_occupant_ek=None,
+ marker_id=properties.marker.id,
+ displayed_ts=timestamp)
+ app.storage.archive.upsert_row(marker_data)
app.ged.raise_event(
DisplayedReceived(account=self._account,
- jid=jid,
+ jid=properties.remote_jid,
properties=properties,
type=properties.type,
is_muc_pm=properties.is_muc_pm,