diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 490fccc3..d5a6a1dd 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -192,28 +192,6 @@ InputBar::nextText()
return text();
}
-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;
- } else if (completerName == "emoji") {
- auto emojiModel = new emoji::EmojiModel();
- auto proxy = new CompletionProxyModel(emojiModel);
- emojiModel->setParent(proxy);
- return proxy;
- } else if (completerName == "room") {
- auto roomModel = new RoomsModel(true);
- auto proxy = new CompletionProxyModel(roomModel);
- roomModel->setParent(proxy);
- return proxy;
- }
- return nullptr;
-}
-
void
InputBar::send()
{
diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h
index 5af46b0d..acd9e22c 100644
--- a/src/timeline/InputBar.h
+++ b/src/timeline/InputBar.h
@@ -55,8 +55,6 @@ public slots:
bool uploading() const { return uploading_; }
void message(QString body, MarkdownOverride useMarkdown = MarkdownOverride::NOT_SPECIFIED);
- QObject *completerFor(QString completerName);
-
private slots:
void startTyping();
void stopTyping();
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index 74427855..3ed1c21c 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -15,13 +15,16 @@
#include "BlurhashProvider.h"
#include "ChatPage.h"
#include "ColorImageProvider.h"
+#include "CompletionProxyModel.h"
#include "DelegateChooser.h"
#include "DeviceVerificationFlow.h"
#include "Logging.h"
#include "MainWindow.h"
#include "MatrixClient.h"
#include "MxcImageProvider.h"
+#include "RoomsModel.h"
#include "UserSettingsPage.h"
+#include "UsersModel.h"
#include "dialogs/ImageOverlay.h"
#include "emoji/EmojiModel.h"
#include "emoji/Provider.h"
@@ -334,6 +337,12 @@ TimelineViewManager::setHistoryView(const QString &room_id)
}
}
+void
+TimelineViewManager::highlightRoom(const QString &room_id)
+{
+ ChatPage::instance()->highlightRoom(room_id);
+}
+
QString
TimelineViewManager::escapeEmoji(QString str) const
{
@@ -556,3 +565,36 @@ TimelineViewManager::focusMessageInput()
{
emit focusInput();
}
+
+QObject *
+TimelineViewManager::completerFor(QString completerName, QString roomId)
+{
+ if (completerName == "user") {
+ auto userModel = new UsersModel(roomId.toStdString());
+ auto proxy = new CompletionProxyModel(userModel);
+ userModel->setParent(proxy);
+ return proxy;
+ } else if (completerName == "emoji") {
+ auto emojiModel = new emoji::EmojiModel();
+ auto proxy = new CompletionProxyModel(emojiModel);
+ emojiModel->setParent(proxy);
+ return proxy;
+ } else if (completerName == "room") {
+ auto roomModel = new RoomsModel(false);
+ auto proxy = new CompletionProxyModel(roomModel, 4);
+ roomModel->setParent(proxy);
+ return proxy;
+ } else if (completerName == "roomAliases") {
+ auto roomModel = new RoomsModel(true);
+ auto proxy = new CompletionProxyModel(roomModel);
+ roomModel->setParent(proxy);
+ return proxy;
+ }
+ return nullptr;
+}
+
+void
+TimelineViewManager::focusTimeline()
+{
+ getWidget()->setFocus();
+}
\ No newline at end of file
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 097fccfc..e3ed4991 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -104,6 +104,8 @@ public slots:
}
void setHistoryView(const QString &room_id);
+ void highlightRoom(const QString &room_id);
+ void focusTimeline();
TimelineModel *getHistoryView(const QString &room_id)
{
auto room = models.find(room_id);
@@ -142,6 +144,7 @@ public slots:
}
void backToRooms() { emit showRoomList(); }
+ QObject *completerFor(QString completerName, QString roomId = "");
private:
#ifdef USE_QUICK_VIEW
|