diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp
index 125e229a..30b28120 100644
--- a/src/ChatPage.cpp
+++ b/src/ChatPage.cpp
@@ -504,6 +504,9 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
connect(this, &ChatPage::dropToLoginPageCb, this, &ChatPage::dropToLoginPage);
connect(this, &ChatPage::messageReply, text_input_, &TextInputWidget::addReply);
+ connect(this, &ChatPage::messageReply, this, [this](const RelatedInfo &related) {
+ view_manager_->updateReplyingEvent(QString::fromStdString(related.related_event));
+ });
instance_ = this;
}
diff --git a/src/TextInputWidget.cpp b/src/TextInputWidget.cpp
index b6b51980..7f5da009 100644
--- a/src/TextInputWidget.cpp
+++ b/src/TextInputWidget.cpp
@@ -684,7 +684,7 @@ TextInputWidget::addReply(const RelatedInfo &related)
// input_->setText(QString("> %1: %2\n\n").arg(username).arg(msg));
input_->setFocus();
- input_->showReplyPopup(related);
+ // input_->showReplyPopup(related);
auto cursor = input_->textCursor();
cursor.movePosition(QTextCursor::End);
input_->setTextCursor(cursor);
diff --git a/src/popups/UserMentions.h b/src/popups/UserMentions.h
index d7dfc575..d3877462 100644
--- a/src/popups/UserMentions.h
+++ b/src/popups/UserMentions.h
@@ -47,5 +47,4 @@ private:
QScrollArea *all_scroll_area_;
QWidget *all_scroll_widget_;
};
-
}
\ No newline at end of file
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 63075649..3db55366 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -24,6 +24,8 @@ class TimelineViewManager : public QObject
TimelineModel *timeline MEMBER timeline_ READ activeTimeline NOTIFY activeTimelineChanged)
Q_PROPERTY(
bool isInitialSync MEMBER isInitialSync_ READ isInitialSync NOTIFY initialSyncChanged)
+ Q_PROPERTY(QString replyingEvent READ getReplyingEvent WRITE updateReplyingEvent NOTIFY
+ replyingEventChanged)
public:
TimelineViewManager(QWidget *parent = 0);
@@ -43,8 +45,17 @@ signals:
void updateRoomsLastMessage(QString roomid, const DescInfo &info);
void activeTimelineChanged(TimelineModel *timeline);
void initialSyncChanged(bool isInitialSync);
+ void replyingEventChanged(QString replyingEvent);
public slots:
+ void updateReplyingEvent(const QString &replyingEvent)
+ {
+ if (this->replyingEvent_ != replyingEvent) {
+ this->replyingEvent_ = replyingEvent;
+ emit replyingEventChanged(replyingEvent_);
+ }
+ }
+ QString getReplyingEvent() const { return replyingEvent_; }
void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids);
void initWithMessages(const std::map<QString, mtx::responses::Timeline> &msgs);
@@ -97,4 +108,5 @@ private:
QHash<QString, QSharedPointer<TimelineModel>> models;
TimelineModel *timeline_ = nullptr;
bool isInitialSync_ = true;
+ QString replyingEvent_;
};
|