Send read receipts
Automatically dismiss unread notifications when the window regains focus. fixes #111 fixes #68
This commit is contained in:
parent
c6cf6c2b41
commit
0f363b5f44
11 changed files with 126 additions and 4 deletions
|
|
@ -59,6 +59,7 @@ public:
|
|||
void leaveRoom(const QString &roomId);
|
||||
void sendTypingNotification(const QString &roomid, int timeoutInMillis = 20000);
|
||||
void removeTypingNotification(const QString &roomid);
|
||||
void readEvent(const QString &room_id, const QString &event_id);
|
||||
|
||||
QUrl getHomeServer() { return server_; };
|
||||
int transactionId() { return txn_id_; };
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public slots:
|
|||
void closeJoinRoomDialog(bool isJoining, QString roomAlias);
|
||||
void openLeaveRoomDialog(const QString &room_id);
|
||||
void closeLeaveRoomDialog(bool leaving, const QString &room_id);
|
||||
void clearRoomMessageCount(const QString &room_id);
|
||||
|
||||
private:
|
||||
void calculateUnreadMessageCount();
|
||||
|
|
|
|||
|
|
@ -66,7 +66,8 @@ public:
|
|||
QWidget *parent);
|
||||
|
||||
void setUserAvatar(const QImage &pixmap);
|
||||
DescInfo descriptionMessage() const { return descriptionMsg_; };
|
||||
DescInfo descriptionMessage() const { return descriptionMsg_; }
|
||||
QString eventId() const { return event_id_; }
|
||||
|
||||
~TimelineItem();
|
||||
|
||||
|
|
@ -85,6 +86,7 @@ private:
|
|||
void setupSimpleLayout();
|
||||
|
||||
QString replaceEmoji(const QString &body);
|
||||
QString event_id_;
|
||||
|
||||
DescInfo descriptionMsg_;
|
||||
|
||||
|
|
|
|||
|
|
@ -121,15 +121,20 @@ private slots:
|
|||
|
||||
signals:
|
||||
void updateLastTimelineMessage(const QString &user, const DescInfo &info);
|
||||
void clearUnreadMessageCount(const QString &room_id);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void addTimelineItem(TimelineItem *item, TimelineDirection direction);
|
||||
void updateLastSender(const QString &user_id, TimelineDirection direction);
|
||||
void notifyForLastEvent();
|
||||
void readLastEvent() const;
|
||||
QString getLastEventId() const;
|
||||
|
||||
// Used to determine whether or not we should prefix a message with the
|
||||
// sender's name.
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public:
|
|||
static QMap<QString, QString> DISPLAY_NAMES;
|
||||
|
||||
signals:
|
||||
void clearRoomMessageCount(QString roomid);
|
||||
void unreadMessages(QString roomid, int count);
|
||||
void updateRoomsLastMessage(const QString &user, const DescInfo &info);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue