diff --git a/daemon b/daemon index c1b1aaf0136aa03132ff1c7101583d3210844c93..a204b71769f168f4ece750e0faf369f4b91f7ce2 160000 --- a/daemon +++ b/daemon @@ -1 +1 @@ -Subproject commit c1b1aaf0136aa03132ff1c7101583d3210844c93 +Subproject commit a204b71769f168f4ece750e0faf369f4b91f7ce2 diff --git a/src/app/calladapter.cpp b/src/app/calladapter.cpp index fe6f7d4cc2567f3db7739608f7848cea91f20539..90313c0bce0dac8259d706a57e99395999f2d2f8 100644 --- a/src/app/calladapter.cpp +++ b/src/app/calladapter.cpp @@ -127,6 +127,7 @@ CallAdapter::onCallStatusChanged(const QString& accountId, const QString& callId auto& accInfo = lrcInstance_->accountModel().getAccountInfo(accountId); auto& callModel = accInfo.callModel; const auto call = callModel->getCall(callId); + auto to = lrcInstance_->accountModel().bestNameForAccount(accountId); const auto& convInfo = lrcInstance_->getConversationFromCallId(callId, accountId); if (convInfo.uid.isEmpty() || call.isOutgoing) @@ -149,7 +150,7 @@ CallAdapter::onCallStatusChanged(const QString& accountId, const QString& callId auto from = accInfo.conversationModel->title(convInfo.uid); auto notifId = QString("%1;%2").arg(accountId).arg(convInfo.uid); systemTray_->showNotification(notifId, - tr("Missed call"), + tr("%1 missed call").arg(to), tr("Missed call with %1").arg(from), NotificationType::CHAT, Utils::QImageToByteArray(convAvatar)); @@ -569,6 +570,7 @@ CallAdapter::showNotification(const QString& accountId, const QString& convUid) { auto& accInfo = lrcInstance_->getAccountInfo(accountId); auto title = accInfo.conversationModel->title(convUid); + auto to = lrcInstance_->accountModel().bestNameForAccount(accountId); auto preferences = accInfo.conversationModel->getConversationPreferences(convUid); // Ignore notifications for this conversation @@ -579,7 +581,7 @@ CallAdapter::showNotification(const QString& accountId, const QString& convUid) auto convAvatar = Utils::conversationAvatar(lrcInstance_, convUid, QSize(50, 50), accountId); auto notifId = QString("%1;%2").arg(accountId).arg(convUid); systemTray_->showNotification(notifId, - tr("Incoming call"), + tr("%1 incoming call").arg(to), tr("%1 is calling you").arg(title), NotificationType::CALL, Utils::QImageToByteArray(convAvatar)); diff --git a/src/app/conversationsadapter.cpp b/src/app/conversationsadapter.cpp index 6796c048eeb3b78ddfa399942392d594708d5227..5f70cabaeaf501ace975b1133196ff7277ce120b 100644 --- a/src/app/conversationsadapter.cpp +++ b/src/app/conversationsadapter.cpp @@ -164,11 +164,17 @@ ConversationsAdapter::onNewUnreadInteraction(const QString& accountId, const interaction::Info& interaction) { if (!QApplication::focusWindow() || accountId != lrcInstance_->get_currentAccountId() - || convUid != lrcInstance_->get_selectedConvUid()) { + || convUid != lrcInstance_->get_selectedConvUid()) { auto& accountInfo = lrcInstance_->getAccountInfo(accountId); if (interaction.authorUri == accountInfo.profileInfo.uri) return; auto from = accountInfo.contactModel->bestNameForContact(interaction.authorUri); + auto to = lrcInstance_->accountModel().bestNameForAccount(accountId); + auto body_ = interaction.body; + + if (interaction.type == interaction::Type::DATA_TRANSFER) { + body_ = interaction.commit.value("displayName"); + } auto preferences = accountInfo.conversationModel->getConversationPreferences(convUid); // Ignore notifications for this conversation @@ -181,8 +187,8 @@ ConversationsAdapter::onNewUnreadInteraction(const QString& accountId, accountId); auto notifId = QString("%1;%2;%3").arg(accountId).arg(convUid).arg(interactionId); systemTray_->showNotification(notifId, - tr("New message"), - from + ": " + interaction.body, + tr("%1 received a new message").arg(to), + from + ": " + body_, NotificationType::CHAT, Utils::QImageToByteArray(contactPhoto)); @@ -232,6 +238,7 @@ ConversationsAdapter::onNewTrustRequest(const QString& accountId, } auto& accInfo = lrcInstance_->getAccountInfo(accountId); auto from = accInfo.contactModel->bestNameForContact(peerUri); + auto to = lrcInstance_->accountModel().bestNameForAccount(accountId); auto preferences = accInfo.conversationModel->getConversationPreferences(convId); // Ignore notifications for this conversation @@ -240,7 +247,7 @@ ConversationsAdapter::onNewTrustRequest(const QString& accountId, auto contactPhoto = Utils::contactPhoto(lrcInstance_, peerUri, QSize(50, 50), accountId); auto notifId = QString("%1;%2").arg(accountId).arg(conv); systemTray_->showNotification(notifId, - tr("Trust request"), + tr("%1 received a new trust request").arg(to), "New request from " + from, NotificationType::REQUEST, Utils::QImageToByteArray(contactPhoto));