summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-07-18 19:15:50 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-07-18 19:15:50 +0200
commit36e4405f259f4043e0e88a967462f5d1641649be (patch)
treeec4e7c51a753a50fe7729165213c16d6890e1d49 /src/timeline
parentFix encryption indicator (diff)
downloadnheko-36e4405f259f4043e0e88a967462f5d1641649be.tar.xz
Fix flickering of encrypted messages when sending using new store
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineModel.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index b1cb2d5e..8e5b245b 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -772,10 +772,11 @@ TimelineModel::sendEncryptedMessage(const std::string txn_id, nlohmann::json con
                         mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> event;
                         event.content =
                           olm::encrypt_group_message(room_id, http::client()->device_id(), doc);
-                        event.event_id = txn_id;
-                        event.room_id  = room_id;
-                        event.sender   = http::client()->user_id().to_string();
-                        event.type     = mtx::events::EventType::RoomEncrypted;
+                        event.event_id         = txn_id;
+                        event.room_id          = room_id;
+                        event.sender           = http::client()->user_id().to_string();
+                        event.type             = mtx::events::EventType::RoomEncrypted;
+                        event.origin_server_ts = QDateTime::currentMSecsSinceEpoch();
 
                         emit this->addPendingMessageToStore(event);
                         return;
@@ -811,10 +812,11 @@ TimelineModel::sendEncryptedMessage(const std::string txn_id, nlohmann::json con
                                 mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> event;
                                 event.content = olm::encrypt_group_message(
                                   room_id, http::client()->device_id(), doc);
-                                event.event_id = txn_id;
-                                event.room_id  = room_id;
-                                event.sender   = http::client()->user_id().to_string();
-                                event.type     = mtx::events::EventType::RoomEncrypted;
+                                event.event_id         = txn_id;
+                                event.room_id          = room_id;
+                                event.sender           = http::client()->user_id().to_string();
+                                event.type             = mtx::events::EventType::RoomEncrypted;
+                                event.origin_server_ts = QDateTime::currentMSecsSinceEpoch();
 
                                 emit this->addPendingMessageToStore(event);
                         } catch (const lmdb::error &e) {