mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
fix crash when account null
fix notification display if max instances reached
This commit is contained in:
parent
e3edeb1bcf
commit
5bbffa79d8
4 changed files with 18 additions and 17 deletions
|
|
@ -130,7 +130,7 @@ Notifier::~Notifier() {
|
||||||
bool Notifier::createNotification(Notifier::NotificationType type, QVariantMap data) {
|
bool Notifier::createNotification(Notifier::NotificationType type, QVariantMap data) {
|
||||||
mMutex->lock();
|
mMutex->lock();
|
||||||
// Q_ASSERT(mInstancesNumber <= MaxNotificationsNumber);
|
// Q_ASSERT(mInstancesNumber <= MaxNotificationsNumber);
|
||||||
if (mInstancesNumber == MaxNotificationsNumber) { // Check existing instances.
|
if (mInstancesNumber >= MaxNotificationsNumber) { // Check existing instances.
|
||||||
qWarning() << QStringLiteral("Unable to create another notification.");
|
qWarning() << QStringLiteral("Unable to create another notification.");
|
||||||
mMutex->unlock();
|
mMutex->unlock();
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -332,7 +332,8 @@ void Notifier::notifyReceivedMessages(const std::shared_ptr<linphone::ChatRoom>
|
||||||
if (receiverAccount) {
|
if (receiverAccount) {
|
||||||
auto senderAccount = ToolModel::findAccount(message->getFromAddress());
|
auto senderAccount = ToolModel::findAccount(message->getFromAddress());
|
||||||
auto currentAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
|
auto currentAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
|
||||||
if (senderAccount && senderAccount->getContactAddress()->weakEqual(currentAccount->getContactAddress())) {
|
if (senderAccount && senderAccount->getContactAddress() && currentAccount->getContactAddress() &&
|
||||||
|
senderAccount->getContactAddress()->weakEqual(currentAccount->getContactAddress())) {
|
||||||
qDebug() << "sender is current account, return";
|
qDebug() << "sender is current account, return";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5017,30 +5017,30 @@ Error</extracomment>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="361"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="362"/>
|
||||||
<source>new_voice_message</source>
|
<source>new_voice_message</source>
|
||||||
<extracomment>'Voice message received!' : message to warn the user in a notofication for voice messages.</extracomment>
|
<extracomment>'Voice message received!' : message to warn the user in a notofication for voice messages.</extracomment>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="362"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="363"/>
|
||||||
<source>new_file_message</source>
|
<source>new_file_message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="365"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="366"/>
|
||||||
<source>new_conference_invitation</source>
|
<source>new_conference_invitation</source>
|
||||||
<extracomment>'Conference invitation received!' : Notification about receiving an invitation to a conference.</extracomment>
|
<extracomment>'Conference invitation received!' : Notification about receiving an invitation to a conference.</extracomment>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="386"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="387"/>
|
||||||
<source>new_chat_room_messages</source>
|
<source>new_chat_room_messages</source>
|
||||||
<extracomment>'New messages received!' Notification that warn the user of new messages.</extracomment>
|
<extracomment>'New messages received!' Notification that warn the user of new messages.</extracomment>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="414"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="415"/>
|
||||||
<source>new_message_alert_accessible_name</source>
|
<source>new_message_alert_accessible_name</source>
|
||||||
<extracomment>New message on chatroom %1</extracomment>
|
<extracomment>New message on chatroom %1</extracomment>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
|
|
||||||
|
|
@ -4924,30 +4924,30 @@ Expiration : %1</translation>
|
||||||
<translation>New call from %1</translation>
|
<translation>New call from %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="361"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="362"/>
|
||||||
<source>new_voice_message</source>
|
<source>new_voice_message</source>
|
||||||
<extracomment>'Voice message received!' : message to warn the user in a notofication for voice messages.</extracomment>
|
<extracomment>'Voice message received!' : message to warn the user in a notofication for voice messages.</extracomment>
|
||||||
<translation>Voice message received!</translation>
|
<translation>Voice message received!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="362"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="363"/>
|
||||||
<source>new_file_message</source>
|
<source>new_file_message</source>
|
||||||
<translation>File received!</translation>
|
<translation>File received!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="365"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="366"/>
|
||||||
<source>new_conference_invitation</source>
|
<source>new_conference_invitation</source>
|
||||||
<extracomment>'Conference invitation received!' : Notification about receiving an invitation to a conference.</extracomment>
|
<extracomment>'Conference invitation received!' : Notification about receiving an invitation to a conference.</extracomment>
|
||||||
<translation>Conference invitation received !</translation>
|
<translation>Conference invitation received !</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="386"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="387"/>
|
||||||
<source>new_chat_room_messages</source>
|
<source>new_chat_room_messages</source>
|
||||||
<extracomment>'New messages received!' Notification that warn the user of new messages.</extracomment>
|
<extracomment>'New messages received!' Notification that warn the user of new messages.</extracomment>
|
||||||
<translation>New messages received !</translation>
|
<translation>New messages received !</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="414"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="415"/>
|
||||||
<source>new_message_alert_accessible_name</source>
|
<source>new_message_alert_accessible_name</source>
|
||||||
<extracomment>New message on chatroom %1</extracomment>
|
<extracomment>New message on chatroom %1</extracomment>
|
||||||
<translation>New message on chatroom %1</translation>
|
<translation>New message on chatroom %1</translation>
|
||||||
|
|
|
||||||
|
|
@ -4924,30 +4924,30 @@ Expiration : %1</translation>
|
||||||
<translation>Nouvel appel de %1</translation>
|
<translation>Nouvel appel de %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="361"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="362"/>
|
||||||
<source>new_voice_message</source>
|
<source>new_voice_message</source>
|
||||||
<extracomment>'Voice message received!' : message to warn the user in a notofication for voice messages.</extracomment>
|
<extracomment>'Voice message received!' : message to warn the user in a notofication for voice messages.</extracomment>
|
||||||
<translation>Message vocal reçu !</translation>
|
<translation>Message vocal reçu !</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="362"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="363"/>
|
||||||
<source>new_file_message</source>
|
<source>new_file_message</source>
|
||||||
<translation>Fichier reçu !</translation>
|
<translation>Fichier reçu !</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="365"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="366"/>
|
||||||
<source>new_conference_invitation</source>
|
<source>new_conference_invitation</source>
|
||||||
<extracomment>'Conference invitation received!' : Notification about receiving an invitation to a conference.</extracomment>
|
<extracomment>'Conference invitation received!' : Notification about receiving an invitation to a conference.</extracomment>
|
||||||
<translation>Nouvelle invitation à une conférence !</translation>
|
<translation>Nouvelle invitation à une conférence !</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="386"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="387"/>
|
||||||
<source>new_chat_room_messages</source>
|
<source>new_chat_room_messages</source>
|
||||||
<extracomment>'New messages received!' Notification that warn the user of new messages.</extracomment>
|
<extracomment>'New messages received!' Notification that warn the user of new messages.</extracomment>
|
||||||
<translation>Nouveaux messages reçus !</translation>
|
<translation>Nouveaux messages reçus !</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../core/notifier/Notifier.cpp" line="414"/>
|
<location filename="../../core/notifier/Notifier.cpp" line="415"/>
|
||||||
<source>new_message_alert_accessible_name</source>
|
<source>new_message_alert_accessible_name</source>
|
||||||
<extracomment>New message on chatroom %1</extracomment>
|
<extracomment>New message on chatroom %1</extracomment>
|
||||||
<translation>Nouveau message sur la conversation %1</translation>
|
<translation>Nouveau message sur la conversation %1</translation>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue