|
|
|
@ -28,6 +28,12 @@ NotificationsManager::NotificationsManager(QObject *parent) |
|
|
|
|
"NotificationClosed", |
|
|
|
|
this, |
|
|
|
|
SLOT(notificationClosed(uint, uint))); |
|
|
|
|
QDBusConnection::sessionBus().connect("org.freedesktop.Notifications", |
|
|
|
|
"/org/freedesktop/Notifications", |
|
|
|
|
"org.freedesktop.Notifications", |
|
|
|
|
"NotificationReplied", |
|
|
|
|
this, |
|
|
|
|
SLOT(notificationReplied(uint, QString))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
@ -61,7 +67,12 @@ NotificationsManager::showNotification(const QString summary, |
|
|
|
|
argumentList << ""; // app_icon
|
|
|
|
|
argumentList << summary; // summary
|
|
|
|
|
argumentList << text; // body
|
|
|
|
|
argumentList << (QStringList("default") << "reply"); // actions
|
|
|
|
|
// The list of actions has always the action name and then a localized version of that
|
|
|
|
|
// action. Currently we just use an empty string for that.
|
|
|
|
|
// TODO(Nico): Look into what to actually put there.
|
|
|
|
|
argumentList << (QStringList("default") << "" |
|
|
|
|
<< "inline-reply" |
|
|
|
|
<< ""); // actions
|
|
|
|
|
argumentList << hints; // hints
|
|
|
|
|
argumentList << (int)-1; // timeout in ms
|
|
|
|
|
|
|
|
|
@ -121,10 +132,21 @@ NotificationsManager::removeNotification(const QString &roomId, const QString &e |
|
|
|
|
void |
|
|
|
|
NotificationsManager::actionInvoked(uint id, QString action) |
|
|
|
|
{ |
|
|
|
|
if (action == "default" && notificationIds.contains(id)) { |
|
|
|
|
if (notificationIds.contains(id)) { |
|
|
|
|
roomEventId idEntry = notificationIds[id]; |
|
|
|
|
if (action == "default") { |
|
|
|
|
emit notificationClicked(idEntry.roomId, idEntry.eventId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
NotificationsManager::notificationReplied(uint id, QString reply) |
|
|
|
|
{ |
|
|
|
|
if (notificationIds.contains(id)) { |
|
|
|
|
roomEventId idEntry = notificationIds[id]; |
|
|
|
|
emit sendNotificationReply(idEntry.roomId, idEntry.eventId, reply); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|