Changeset View
Changeset View
Standalone View
Standalone View
plugins/notifications/notificationsdbusinterface.cpp
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | |||||
59 | void NotificationsDbusInterface::processPackage(const NetworkPackage& np) | 59 | void NotificationsDbusInterface::processPackage(const NetworkPackage& np) | ||
60 | { | 60 | { | ||
61 | if (np.get<bool>(QStringLiteral("isCancel"))) { | 61 | if (np.get<bool>(QStringLiteral("isCancel"))) { | ||
62 | QString id = np.get<QString>(QStringLiteral("id")); | 62 | QString id = np.get<QString>(QStringLiteral("id")); | ||
63 | // cut off kdeconnect-android's prefix if there: | 63 | // cut off kdeconnect-android's prefix if there: | ||
64 | if (id.startsWith(QLatin1String("org.kde.kdeconnect_tp::"))) | 64 | if (id.startsWith(QLatin1String("org.kde.kdeconnect_tp::"))) | ||
65 | id = id.mid(id.indexOf(QLatin1String("::")) + 2); | 65 | id = id.mid(id.indexOf(QLatin1String("::")) + 2); | ||
66 | removeNotification(id); | 66 | removeNotification(id); | ||
67 | } else if (np.get<bool>(QStringLiteral("isRequest"))) { | | |||
albertvaka: Isn't this a typo and it should be "request" instead?
There is code on the Android side… | |||||
It seems so. But I don't see why the Receive notificationsplugin (the phone) would ask the notificationsplugin (desktop) for it's notifications (they origin from the phone anyway). If anyone the sendnotifications plugin (desktop) should answer that request nicolasfella: It seems so. But I don't see why the Receive notificationsplugin (the phone) would ask the… | |||||
68 | for (const auto& n : qAsConst(m_notifications)) { | | |||
69 | NetworkPackage np(PACKAGE_TYPE_NOTIFICATION_REQUEST, { | | |||
70 | {"id", n->internalId()}, | | |||
71 | {"appName", n->appName()}, | | |||
72 | {"ticker", n->ticker()}, | | |||
73 | {"isClearable", n->dismissable()}, | | |||
74 | {"requestAnswer", true} | | |||
75 | }); | | |||
76 | m_plugin->sendPackage(np); | | |||
77 | } | | |||
78 | } else if(np.get<bool>(QStringLiteral("requestAnswer"), false)) { | | |||
79 | | ||||
80 | } else { | 67 | } else { | ||
81 | QString id = np.get<QString>(QStringLiteral("id")); | 68 | QString id = np.get<QString>(QStringLiteral("id")); | ||
82 | 69 | | |||
83 | if (!m_internalIdToPublicId.contains(id)) { | 70 | if (!m_internalIdToPublicId.contains(id)) { | ||
84 | Notification* noti = new Notification(np, this); | 71 | Notification* noti = new Notification(np, this); | ||
85 | 72 | | |||
86 | if (noti->isReady()) { | 73 | if (noti->isReady()) { | ||
87 | addNotification(noti); | 74 | addNotification(noti); | ||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |
Isn't this a typo and it should be "request" instead?
There is code on the Android side (ReceiveNotifications.java) that sends a "request" to receive all the current notifications.