Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCamila <hello@camila.codes>2022-09-29 16:14:01 +0300
committerCamila <hello@camila.codes>2022-09-29 16:20:56 +0300
commit7633cc490df3b7984c2c56d113b28abe6c508138 (patch)
tree1f351424ab0b40c78ede292b6cd3ff4e02e92b57 /src
parentcbe22d8c1ebee69c3414deae485ff4707e037054 (diff)
Fix 'Reply' action primary property.
Primary is set to true when object type is 'room' or 'chat' and it set to false when object type is 'call'. Signed-off-by: Camila <hello@camila.codes>
Diffstat (limited to 'src')
-rw-r--r--src/gui/tray/activitylistmodel.cpp6
-rw-r--r--src/gui/tray/notificationhandler.cpp23
2 files changed, 17 insertions, 12 deletions
diff --git a/src/gui/tray/activitylistmodel.cpp b/src/gui/tray/activitylistmodel.cpp
index ebcd646e1..de4d79c02 100644
--- a/src/gui/tray/activitylistmodel.cpp
+++ b/src/gui/tray/activitylistmodel.cpp
@@ -782,11 +782,7 @@ QVariantList ActivityListModel::convertLinksToActionButtons(const Activity &acti
}
for (const auto &activityLink : activity._links) {
- if (activityLink._primary
- || activityLink._verb == QStringLiteral("DELETE")
- || activityLink._verb == QStringLiteral("WEB")) {
- customList << ActivityListModel::convertLinkToActionButton(activityLink);
- }
+ customList << ActivityListModel::convertLinkToActionButton(activityLink);
}
return customList;
diff --git a/src/gui/tray/notificationhandler.cpp b/src/gui/tray/notificationhandler.cpp
index 5ab8ea213..02105bf93 100644
--- a/src/gui/tray/notificationhandler.cpp
+++ b/src/gui/tray/notificationhandler.cpp
@@ -110,27 +110,36 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j
if (a._objectType == "chat" || a._objectType == "call" || a._objectType == "room") {
const auto objectId = json.value("object_id").toString();
const auto objectIdData = objectId.split("/");
+
+ ActivityLink al;
+ al._label = tr("Reply");
+ al._verb = "REPLY";
+ al._primary = true;
+
a._talkNotificationData.conversationToken = objectIdData.first();
+
if (a._objectType == "chat" && objectIdData.size() > 1) {
a._talkNotificationData.messageId = objectIdData.last();
} else {
qCInfo(lcServerNotification) << "Replying directly to Talk conversation" << a._talkNotificationData.conversationToken << "will not be possible because the notification doesn't contain the message ID.";
}
- ActivityLink al;
- al._label = tr("Reply");
- al._verb = "REPLY";
- al._primary = true;
- a._links.insert(0, al);
+ if (a._subjectRichParameters.contains("user")) {
+
+ // callback then it is the primary action
+ if (a._objectType == "call") {
+ al._primary = false;
+ }
- if(a._subjectRichParameters.contains("user")) {
a._talkNotificationData.userAvatar = ai->account()->url().toString() + QStringLiteral("/index.php/avatar/") + a._subjectRichParameters["user"].id + QStringLiteral("/128");
}
// We want to serve incoming call dialogs to the user for calls that
- if(a._objectType == "call" && a._dateTime.secsTo(QDateTime::currentDateTime()) < 120) {
+ if (a._objectType == "call" && a._dateTime.secsTo(QDateTime::currentDateTime()) < 120) {
callList.append(a);
}
+
+ a._links.insert(al._primary? 0 : a._links.size(), al);
}
QUrl link(json.value("link").toString());