summary refs log tree commit diff
path: root/src/timeline/TimelineViewManager.cpp
diff options
context:
space:
mode:
authorZhymabek Roman <61125068+ZhymabekRoman@users.noreply.github.com>2023-01-02 21:59:29 +0600
committerGitHub <noreply@github.com>2023-01-02 21:59:29 +0600
commit59410a99ac9b5a90356adc2192b8c6107456c78f (patch)
treef42e081641cee3d62057208f3af1de3afddd02e6 /src/timeline/TimelineViewManager.cpp
parentAppImage: reduce package size (diff)
parentA whole new year full of excitement and possibilities! (diff)
downloadnheko-59410a99ac9b5a90356adc2192b8c6107456c78f.tar.xz
Merge branch 'master' into master
Diffstat (limited to 'src/timeline/TimelineViewManager.cpp')
-rw-r--r--src/timeline/TimelineViewManager.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp

index 9c46d201..ba586ef9 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp
@@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2021 Nheko Contributors // SPDX-FileCopyrightText: 2022 Nheko Contributors +// SPDX-FileCopyrightText: 2023 Nheko Contributors // // SPDX-License-Identifier: GPL-3.0-or-later @@ -10,8 +11,10 @@ #include <QStandardPaths> #include <QString> +#include "Cache.h" #include "ChatPage.h" #include "CombinedImagePackModel.h" +#include "CommandCompleter.h" #include "CompletionProxyModel.h" #include "EventAccessors.h" #include "ImagePackListModel.h" @@ -443,6 +446,11 @@ TimelineViewManager::completerFor(const QString &completerName, const QString &r auto proxy = new CompletionProxyModel(stickerModel); stickerModel->setParent(proxy); return proxy; + } else if (completerName == QLatin1String("command")) { + auto commandCompleter = new CommandCompleter(); + auto proxy = new CompletionProxyModel(commandCompleter); + commandCompleter->setParent(proxy); + return proxy; } return nullptr; } @@ -455,7 +463,7 @@ TimelineViewManager::forwardMessageToRoom(mtx::events::collections::TimelineEven auto content = mtx::accessors::url(*e); std::optional<mtx::crypto::EncryptedFile> encryptionInfo = mtx::accessors::file(*e); - if (encryptionInfo) { + if (encryptionInfo && !cache::isRoomEncrypted(roomId.toStdString())) { http::client()->download( content, [this, roomId, e, encryptionInfo](const std::string &res,