better notification sending, edited message now modifies notification (or sends), little structure change

This commit is contained in:
Blue 2022-04-19 20:24:41 +03:00
parent 18859cb960
commit 83cb220175
Signed by: blue
GPG key ID: 9B203B252A63EE38
13 changed files with 31 additions and 16 deletions

View file

@ -357,8 +357,9 @@ void Shared::Global::notify(const QString& account, const Shared::Message& msg)
QString name = QString(instance->rosterModel->getContactName(account, msg.getPenPalJid()));
QString path = QString(instance->rosterModel->getContactIconPath(account, msg.getPenPalJid(), msg.getPenPalResource()));
QVariantList args;
args << QString(QCoreApplication::applicationName());
args << QVariant(QVariant::UInt); //TODO some normal id
args << QString();
args << qHash(msg.getId());
if (path.size() > 0) {
args << path;
} else {
@ -378,8 +379,13 @@ void Shared::Global::notify(const QString& account, const Shared::Message& msg)
args << body;
args << QStringList();
args << QVariantMap();
args << 3000;
args << QVariantMap({
{"desktop-entry", QString(QCoreApplication::applicationName())},
{"category", QString("message")},
// {"sound-file", "/path/to/macaw/squawk"},
{"sound-name", QString("message-new-instant")}
});
args << -1;
instance->dbus.callWithArgumentList(QDBus::AutoDetect, "Notify", args);
}