Add mark all as read function.
This commit is contained in:
@@ -44,6 +44,12 @@ Dialog {
|
||||
Menu {
|
||||
id: contextMenu
|
||||
|
||||
MenuItem {
|
||||
text: "Mark all as read"
|
||||
|
||||
onClicked: spectralController.markAllMessagesAsRead(connection)
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: "Logout"
|
||||
|
||||
|
||||
@@ -384,3 +384,9 @@ void Controller::changeAvatar(Connection* conn, QUrl localFile) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void Controller::markAllMessagesAsRead(Connection* conn) {
|
||||
for (auto room : conn->roomMap().values()) {
|
||||
room->markAllMessagesAsRead();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ class Controller : public QObject {
|
||||
void createDirectChat(Connection* c, const QString& userID);
|
||||
void playAudio(QUrl localFile);
|
||||
void changeAvatar(Connection* conn, QUrl localFile);
|
||||
void markAllMessagesAsRead(Connection* conn);
|
||||
};
|
||||
|
||||
#endif // CONTROLLER_H
|
||||
|
||||
Reference in New Issue
Block a user