Skip to content

Commit 18c0aac

Browse files
camilasanmgallien
authored andcommitted
fix(notifications): add delete action to notifications.
Fix for #6797 and #8274. Signed-off-by: Camila Ayres <[email protected]>
1 parent eaa5363 commit 18c0aac

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/gui/tray/notificationhandler.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j
171171
activity._links.insert(link._primary? 0 : activity._links.size(), link);
172172
}
173173

174+
// e.g. announcement
175+
if (activity._objectType != "remote_share"_L1 && activity._links.isEmpty()) {
176+
ActivityLink link;
177+
link._label = tr("Dismiss");
178+
link._verb = "DELETE";
179+
link._primary = true;
180+
activity._links.append(link);
181+
}
182+
174183
QUrl url(json.value("link"_L1).toString());
175184
if (!url.isEmpty()) {
176185
if (url.host().isEmpty()) {

0 commit comments

Comments
 (0)