summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-11-20 02:38:08 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-11-25 19:05:12 +0100
commitadd5903fb0abc76d77ce4369c4679a95be03b433 (patch)
tree0c0bbebd80f3f404daaffa2695244578dc4254db /src/timeline
parentadd per-room user model (diff)
downloadnheko-add5903fb0abc76d77ce4369c4679a95be03b433.tar.xz
Working User completer
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/InputBar.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 82649faa..641d8379 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -14,12 +14,14 @@
 #include "Cache.h"
 #include "CallManager.h"
 #include "ChatPage.h"
+#include "CompletionProxyModel.h"
 #include "Logging.h"
 #include "MainWindow.h"
 #include "MatrixClient.h"
 #include "Olm.h"
 #include "TimelineModel.h"
 #include "UserSettingsPage.h"
+#include "UsersModel.h"
 #include "Utils.h"
 #include "dialogs/PlaceCall.h"
 #include "dialogs/PreviewUploadOverlay.h"
@@ -166,6 +168,12 @@ InputBar::nextText()
 QObject *
 InputBar::completerFor(QString completerName)
 {
+        if (completerName == "user") {
+                auto userModel = new UsersModel(room->roomId().toStdString());
+                auto proxy     = new CompletionProxyModel(userModel);
+                userModel->setParent(proxy);
+                return proxy;
+        }
         return nullptr;
 }