Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-3.5] Bugfix/two factor notification #4549

Merged
merged 2 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/gui/tray/activitylistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,9 @@ QVariantList ActivityListModel::convertLinksToActionButtons(const Activity &acti
}

for (const auto &activityLink : activity._links) {
if (activityLink._verb == QStringLiteral("DELETE")
|| (activity._objectType == QStringLiteral("chat") || activity._objectType == QStringLiteral("call")
|| activity._objectType == QStringLiteral("room"))) {
if (activityLink._primary
|| activityLink._verb == QStringLiteral("DELETE")
|| activityLink._verb == QStringLiteral("WEB")) {
customList << ActivityListModel::convertLinkToActionButton(activityLink);
}
}
Expand Down
17 changes: 11 additions & 6 deletions src/gui/tray/notificationhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,17 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j

// Add another action to dismiss notification on server
// https://github.com/owncloud/notifications/blob/master/docs/ocs-endpoint-v1.md#deleting-a-notification-for-a-user
ActivityLink al;
al._label = tr("Dismiss");
al._link = Utility::concatUrlPath(ai->account()->url(), notificationsPath + "/" + QString::number(a._id)).toString();
al._verb = "DELETE";
al._primary = false;
a._links.append(al);
constexpr auto deleteVerb = "DELETE";
if (std::find_if(std::cbegin(a._links), std::cend(a._links), [](const ActivityLink& link) {
return link._verb == deleteVerb;
}) == std::cend(a._links)) {
ActivityLink al;
al._label = tr("Dismiss");
al._link = Utility::concatUrlPath(ai->account()->url(), notificationsPath + "/" + QString::number(a._id)).toString();
al._verb = deleteVerb;
al._primary = false;
a._links.append(al);
}

list.append(a);
}
Expand Down