summary refs log tree commit diff
path: root/src/TextInputWidget.h
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2019-06-09 19:03:18 -0400
committerJoseph Donofry <joedonofry@gmail.com>2019-06-09 19:03:18 -0400
commitb9dde957a83c7198e9c5941c657e785577d11ed5 (patch)
tree0cafadc05fe68ba35fbcd660800d767abdba4113 /src/TextInputWidget.h
parentUpdate CHANGELOG.md with 0.7.0 changes thus far (diff)
downloadnheko-b9dde957a83c7198e9c5941c657e785577d11ed5.tar.xz
Add initial support for rich replies to nheko
Diffstat (limited to 'src/TextInputWidget.h')
-rw-r--r--src/TextInputWidget.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/TextInputWidget.h b/src/TextInputWidget.h
index 8f634f6b..a12183d8 100644
--- a/src/TextInputWidget.h
+++ b/src/TextInputWidget.h
@@ -54,6 +54,7 @@ public:
         QSize minimumSizeHint() const override;
 
         void submit();
+        void setRelatedEvent(const QString &event) { related_event_ = event; }
 
 signals:
         void heightChanged(int height);
@@ -61,6 +62,7 @@ signals:
         void stoppedTyping();
         void startedUpload();
         void message(QString);
+        void reply(QString, QString);
         void command(QString name, QString args);
         void image(QSharedPointer<QIODevice> data, const QString &filename);
         void audio(QSharedPointer<QIODevice> data, const QString &filename);
@@ -94,6 +96,9 @@ private:
 
         SuggestionsPopup popup_;
 
+        // Used for replies
+        QString related_event_;
+
         enum class AnchorType
         {
                 Tab   = 0,
@@ -158,13 +163,14 @@ public slots:
         void openFileSelection();
         void hideUploadSpinner();
         void focusLineEdit() { input_->setFocus(); }
-        void addReply(const QString &username, const QString &msg);
+        void addReply(const QString &username, const QString &msg, const QString &related_event);
 
 private slots:
         void addSelectedEmoji(const QString &emoji);
 
 signals:
         void sendTextMessage(QString msg);
+        void sendReplyMessage(QString msg, QString event_id);
         void sendEmoteMessage(QString msg);
         void heightChanged(int height);
 
@@ -189,6 +195,9 @@ private:
         QHBoxLayout *topLayout_;
         FilteredTextEdit *input_;
 
+        // Used for replies
+        QString related_event_;
+
         LoadingIndicator *spinner_;
 
         FlatButton *sendFileBtn_;