diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-07-15 20:37:52 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-07-19 01:28:07 +0200 |
commit | 8a1666bc889d963693b5dff8f0b4c7612319644a (patch) | |
tree | 80cdae27c4a88287fc08d707e638feecfd36d3da /src/timeline/TimelineModel.cpp | |
parent | Merge pull request #646 from Nheko-Reborn/historical-key-sharing (diff) | |
download | nheko-8a1666bc889d963693b5dff8f0b4c7612319644a.tar.xz |
Basic sticker support
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r-- | src/timeline/TimelineModel.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 5832f56e..abfe28a9 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -1300,6 +1300,14 @@ struct SendMessageVisitor sendRoomEvent<mtx::events::msg::KeyVerificationCancel, mtx::events::EventType::KeyVerificationCancel>(msg); } + void operator()(mtx::events::Sticker msg) + { + msg.type = mtx::events::EventType::Sticker; + if (cache::isRoomEncrypted(model_->room_id_.toStdString())) { + model_->sendEncryptedMessage(msg, mtx::events::EventType::Sticker); + } else + emit model_->addPendingMessageToStore(msg); + } TimelineModel *model_; }; @@ -1309,6 +1317,7 @@ TimelineModel::addPendingMessage(mtx::events::collections::TimelineEvents event) { std::visit( [](auto &msg) { + // gets overwritten for reactions and stickers in SendMessageVisitor msg.type = mtx::events::EventType::RoomMessage; msg.event_id = "m" + http::client()->generate_txn_id(); msg.sender = http::client()->user_id().to_string(); |