summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-07-19 13:31:48 +0000
committerGitHub <noreply@github.com>2021-07-19 13:31:48 +0000
commit9a950c7f0e9a7daac926c78cf98a8b834c02d521 (patch)
treeaba0f1db0658228c81a482b93cf76e976d3ea31f /src/timeline/InputBar.cpp
parentMerge pull request #646 from Nheko-Reborn/historical-key-sharing (diff)
parentMake scrolling sticker picker bearable (diff)
downloadnheko-9a950c7f0e9a7daac926c78cf98a8b834c02d521.tar.xz
Merge pull request #648 from Nheko-Reborn/stickers2
Stickers!
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index b0747a7c..0f210722 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -21,6 +21,7 @@ #include "ChatPage.h" #include "CompletionProxyModel.h" #include "Config.h" +#include "ImagePackModel.h" #include "Logging.h" #include "MainWindow.h" #include "MatrixClient.h" @@ -502,6 +503,22 @@ InputBar::video(const QString &filename, } void +InputBar::sticker(ImagePackModel *model, int row) +{ + if (!model || row < 0) + return; + + auto img = model->imageAt(row); + + mtx::events::msg::StickerImage sticker{}; + sticker.info = img.info.value_or(mtx::common::ImageInfo{}); + sticker.url = img.url; + sticker.body = img.body; + + room->sendMessageEvent(sticker, mtx::events::EventType::Sticker); +} + +void InputBar::command(QString command, QString args) { if (command == "me") {