1 files changed, 14 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index 92fccd2d..5c1065cb 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -14,6 +14,7 @@
#include <mtxclient/http/errors.hpp>
#include "CacheCryptoStructs.h"
+#include "CacheStructs.h"
#include "EventStore.h"
#include "InputBar.h"
#include "Permissions.h"
@@ -253,12 +254,15 @@ public:
}
void updateLastMessage();
+ void sync(const mtx::responses::JoinedRoom &room);
void addEvents(const mtx::responses::Timeline &events);
void syncState(const mtx::responses::State &state);
template<class T>
void sendMessageEvent(const T &content, mtx::events::EventType eventType);
RelatedInfo relatedInfo(QString id);
+ DescInfo lastMessage() const { return lastMessage_; }
+
public slots:
void setCurrentIndex(int index);
int currentIndex() const { return idToIndex(currentId); }
@@ -309,6 +313,9 @@ public slots:
QString roomAvatarUrl() const;
QString roomId() const { return room_id_; }
+ bool hasMentions() { return highlight_count > 0; }
+ int notificationCount() { return notification_count; }
+
QString scrollTarget() const;
private slots:
@@ -328,6 +335,9 @@ signals:
void newCallEvent(const mtx::events::collections::TimelineEvents &event);
void scrollToIndex(int index);
+ void lastMessageChanged();
+ void notificationsChanged();
+
void openRoomSettingsDialog(RoomSettings *settings);
void newMessageToSend(mtx::events::collections::TimelineEvents event);
@@ -372,7 +382,11 @@ private:
QString eventIdToShow;
int showEventTimerCounter = 0;
+ DescInfo lastMessage_;
+
friend struct SendMessageVisitor;
+
+ int notification_count = 0, highlight_count = 0;
};
template<class T>
|