Skip to content

Commit

Permalink
Added model signal for interactive notifications receive.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed Sep 12, 2023
1 parent 691f08d commit b4b1c5f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/gui/tray/Window.qml
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,12 @@ ApplicationWindow {
onActivityItemClicked: {
model.slotTriggerDefaultAction(index)
}
onCountChanged: {
if (contentY > 0) {
newActivitiesButton.active = true;
Connections {
target: activityModel
onInteractiveActivityReceived: {
if (activityList.contentY > 0) {
newActivitiesButton.active = true;
}
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/gui/tray/activitylistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,13 @@ void ActivityListModel::addNotificationToActivityList(const Activity &activity)
qCDebug(lcActivity) << "Notification successfully added to the notification list: " << activity._subject;
addEntriesToActivityList({activity});
_notificationLists.prepend(activity);
for (const auto &link : activity._links) {
if (link._verb == QByteArrayLiteral("POST")
|| link._verb == QByteArrayLiteral("REPLY")
|| link._verb == QByteArrayLiteral("WEB")) {
emit interactiveActivityReceived();
}
}
}

void ActivityListModel::addSyncFileItemToActivityList(const Activity &activity)
Expand Down
2 changes: 2 additions & 0 deletions src/gui/tray/activitylistmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public slots:
void activityJobStatusCode(int statusCode);
void sendNotificationRequest(const QString &accountName, const QString &link, const QByteArray &verb, int row);

void interactiveActivityReceived();

protected:
[[nodiscard]] bool currentlyFetching() const;

Expand Down

0 comments on commit b4b1c5f

Please sign in to comment.