mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 13:08:48 +03:00
Fix flickering of encrypted messages when sending using new store
This commit is contained in:
parent
a5dda86a6c
commit
36e4405f25
1 changed files with 10 additions and 8 deletions
|
@ -772,10 +772,11 @@ TimelineModel::sendEncryptedMessage(const std::string txn_id, nlohmann::json con
|
||||||
mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> event;
|
mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> event;
|
||||||
event.content =
|
event.content =
|
||||||
olm::encrypt_group_message(room_id, http::client()->device_id(), doc);
|
olm::encrypt_group_message(room_id, http::client()->device_id(), doc);
|
||||||
event.event_id = txn_id;
|
event.event_id = txn_id;
|
||||||
event.room_id = room_id;
|
event.room_id = room_id;
|
||||||
event.sender = http::client()->user_id().to_string();
|
event.sender = http::client()->user_id().to_string();
|
||||||
event.type = mtx::events::EventType::RoomEncrypted;
|
event.type = mtx::events::EventType::RoomEncrypted;
|
||||||
|
event.origin_server_ts = QDateTime::currentMSecsSinceEpoch();
|
||||||
|
|
||||||
emit this->addPendingMessageToStore(event);
|
emit this->addPendingMessageToStore(event);
|
||||||
return;
|
return;
|
||||||
|
@ -811,10 +812,11 @@ TimelineModel::sendEncryptedMessage(const std::string txn_id, nlohmann::json con
|
||||||
mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> event;
|
mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> event;
|
||||||
event.content = olm::encrypt_group_message(
|
event.content = olm::encrypt_group_message(
|
||||||
room_id, http::client()->device_id(), doc);
|
room_id, http::client()->device_id(), doc);
|
||||||
event.event_id = txn_id;
|
event.event_id = txn_id;
|
||||||
event.room_id = room_id;
|
event.room_id = room_id;
|
||||||
event.sender = http::client()->user_id().to_string();
|
event.sender = http::client()->user_id().to_string();
|
||||||
event.type = mtx::events::EventType::RoomEncrypted;
|
event.type = mtx::events::EventType::RoomEncrypted;
|
||||||
|
event.origin_server_ts = QDateTime::currentMSecsSinceEpoch();
|
||||||
|
|
||||||
emit this->addPendingMessageToStore(event);
|
emit this->addPendingMessageToStore(event);
|
||||||
} catch (const lmdb::error &e) {
|
} catch (const lmdb::error &e) {
|
||||||
|
|
Loading…
Reference in a new issue