diff --git a/CHANGELOG.md b/CHANGELOG.md
index be8b49cf0..024ce7e20 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Colored Emojis with its own font family.
- OAuth2 connection to retrieve remote provisioning (Experimental and not usable without configuration).
- Add/View contact from a message.
+- Mute option for each chatrooms.
## 5.0.11 - undefined
diff --git a/linphone-app/assets/images/notifications_off_custom.svg b/linphone-app/assets/images/notifications_off_custom.svg
new file mode 100644
index 000000000..e56a4f294
--- /dev/null
+++ b/linphone-app/assets/images/notifications_off_custom.svg
@@ -0,0 +1,66 @@
+
+
diff --git a/linphone-app/assets/images/notifications_on_custom.svg b/linphone-app/assets/images/notifications_on_custom.svg
new file mode 100644
index 000000000..207c6c47b
--- /dev/null
+++ b/linphone-app/assets/images/notifications_on_custom.svg
@@ -0,0 +1,75 @@
+
+
diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts
index 4471d59cc..86f306933 100644
--- a/linphone-app/assets/languages/da.ts
+++ b/linphone-app/assets/languages/da.ts
@@ -1103,6 +1103,16 @@ Server url ikke konfigureret.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts
index dfc6704a5..d1be49498 100644
--- a/linphone-app/assets/languages/de.ts
+++ b/linphone-app/assets/languages/de.ts
@@ -1103,6 +1103,16 @@ Server URL ist nicht konfiguriert.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts
index 6441a15a2..ce34206f0 100644
--- a/linphone-app/assets/languages/en.ts
+++ b/linphone-app/assets/languages/en.ts
@@ -1103,6 +1103,16 @@ Server URL not configured.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
Schedule a meeting
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+ Disable notifications
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+ Enable notifications
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts
index 969633c13..ebd873a8e 100644
--- a/linphone-app/assets/languages/es.ts
+++ b/linphone-app/assets/languages/es.ts
@@ -1103,6 +1103,16 @@ URL del servidor no configurada.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts
index 8ad71f49f..771ed783e 100644
--- a/linphone-app/assets/languages/fr_FR.ts
+++ b/linphone-app/assets/languages/fr_FR.ts
@@ -173,7 +173,7 @@
usernameStatusInvalidCharacters
- Caractères invalides détectés (regex : `%1`).
+ Caractères invalides détectés (regex : `%1`).
usernameStatusInvalid
@@ -189,7 +189,7 @@
passwordStatusInvalidCharacters
- Caractères invalides détectés (regex : `%1`).
+ Caractères invalides détectés (regex : `%1`).
passwordStatusMissingCharacters
@@ -1103,6 +1103,16 @@ URL du serveur non configurée.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
Planifier une réunion
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
@@ -1259,7 +1269,7 @@ URL du serveur non configurée.
ephemeralNotInConference!
'Ephemeral message is only supported in conference based chat room!'
- Les messages éphémères ne sont disponibles que pour une conversation définie en mode conférence !
+ Les messages éphémères ne sont disponibles que pour une conversation définie en mode conférence !
Warning about not being in conference based chat room.
@@ -2066,7 +2076,7 @@ Cliquez ici : <a href="%1">%1</a>
newConferenceScheduleTitle
'Would you like to schedule your meeting?' : Ask about setting the meeting as scheduled.
- Voulez-vous programmer cette réunion ?
+ Voulez-vous programmer cette réunion ?
newConferenceDate
@@ -2535,12 +2545,12 @@ Cliquez ici : <a href="%1">%1</a>
vfsDeactivation
'Are you sure to deactivate the encryption? The application will exit and all your data will be lost. You must delete them before using the application.' : Explanation to deactivate the VFS encryption.
- Êtes-vous certain de désactiver le chiffrement de l'application ? Elle redémarrera et toutes vos données seront perdues. Vous devez les supprimer avant d'utiliser l'application.
+ Êtes-vous certain de désactiver le chiffrement de l'application ? Elle redémarrera et toutes vos données seront perdues. Vous devez les supprimer avant d'utiliser l'application.
vfsActivation
'Are you sure to activate the encryption? You cannot revert without deleting ALL your data' : Explanation to activate the VFS encryption.
- Êtes-vous certain d'activer le chiffrement ? Cette action est irréversible sans perdre TOUTES vos données.
+ Êtes-vous certain d'activer le chiffrement ? Cette action est irréversible sans perdre TOUTES vos données.
cancel
@@ -2809,7 +2819,7 @@ Cliquez ici : <a href="%1">%1</a>
serverTooltip
- Serveur LDAP. ie : ldap:// pour un serveur local ou ldap://ldap.example.org/
+ Serveur LDAP. ie : ldap:// pour un serveur local ou ldap://ldap.example.org/
bindDNLabel
@@ -3755,7 +3765,7 @@ Cliquez ici : <a href="%1">%1</a>
deleteTimeline
'Are you sure you want to delete and leave this timeline?'
- Êtes-vous certain de vouloir tout effacer et de quitter cette conversation ?
+ Êtes-vous certain de vouloir tout effacer et de quitter cette conversation ?
deleteTimelineTooltip
@@ -3877,15 +3887,15 @@ Cliquez ici : <a href="%1">%1</a>
VfsUtils
Delete key failed: %1
- Échec lors de la suppression de la clef : %1
+ Échec lors de la suppression de la clef : %1
Read key failed: %1
- Échec lors de la lecture de la clef : %1
+ Échec lors de la lecture de la clef : %1
Write key failed: %1
- Échec lors de l'écriture de la clef : %1
+ Échec lors de l'écriture de la clef : %1
diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts
index d4e22857a..d284ab57e 100644
--- a/linphone-app/assets/languages/hu.ts
+++ b/linphone-app/assets/languages/hu.ts
@@ -1097,6 +1097,16 @@ A kiszolgáló URL-je nincs konfigurálva.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts
index 0c932f038..585b308c1 100644
--- a/linphone-app/assets/languages/it.ts
+++ b/linphone-app/assets/languages/it.ts
@@ -1103,6 +1103,16 @@ URL del server non configurato.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts
index 5d9883e97..e881da227 100644
--- a/linphone-app/assets/languages/ja.ts
+++ b/linphone-app/assets/languages/ja.ts
@@ -1097,6 +1097,16 @@
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts
index b9a609c4b..3fbd15949 100644
--- a/linphone-app/assets/languages/lt.ts
+++ b/linphone-app/assets/languages/lt.ts
@@ -1109,6 +1109,16 @@ Nesukonfigūruotas serverio url.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts
index ed26f4f1d..cd0007ef0 100644
--- a/linphone-app/assets/languages/pt_BR.ts
+++ b/linphone-app/assets/languages/pt_BR.ts
@@ -1103,6 +1103,16 @@ URL do servidor não configurado.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts
index 388e52168..e92ae1bc4 100644
--- a/linphone-app/assets/languages/ru.ts
+++ b/linphone-app/assets/languages/ru.ts
@@ -1109,6 +1109,16 @@
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
Запланировать встречу
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts
index 929f6ac0f..52c4bd2a3 100644
--- a/linphone-app/assets/languages/sv.ts
+++ b/linphone-app/assets/languages/sv.ts
@@ -1103,6 +1103,16 @@ Serverwebbadressen är inte konfigurerad.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts
index 17ee2158c..83631d8fe 100644
--- a/linphone-app/assets/languages/tr.ts
+++ b/linphone-app/assets/languages/tr.ts
@@ -1097,6 +1097,16 @@ Sunucu url'si yapılandırılmadı.
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts
index 6680c13d7..5e7e2bca5 100644
--- a/linphone-app/assets/languages/uk.ts
+++ b/linphone-app/assets/languages/uk.ts
@@ -1109,6 +1109,16 @@
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts
index 60de93b66..9b5e16f57 100644
--- a/linphone-app/assets/languages/zh_CN.ts
+++ b/linphone-app/assets/languages/zh_CN.ts
@@ -1097,6 +1097,16 @@
'Schedule a meeting' : Item menu to schedule a meeting with the chat participants.
+
+ conversationMenuDeactivate
+ 'Disable notifications' : Item menu to disable chat's notifications
+
+
+
+ conversationMenuActivate
+ 'Enable notifications' : Item menu to enable chat's notifications
+
+
CreateAppSipAccount
diff --git a/linphone-app/cmake_builder/linphone_package/windows/ReadMe_banner.txt b/linphone-app/cmake_builder/linphone_package/windows/ReadMe_banner.txt
new file mode 100644
index 000000000..20349f27a
--- /dev/null
+++ b/linphone-app/cmake_builder/linphone_package/windows/ReadMe_banner.txt
@@ -0,0 +1,6 @@
+nsis_banner should be in old format.
+file nsis_banner.bmp => "PC bitmap, Windows 98/2000 and newer format" is not good.
+
+
+convert nsis_banner.bmp BMP3:nsis_banner.bmp
+file nsis_banner.bmp => "PC bitmap, Windows 3.x format" OK
diff --git a/linphone-app/resources.qrc b/linphone-app/resources.qrc
index 044f44a3f..e82f84e91 100644
--- a/linphone-app/resources.qrc
+++ b/linphone-app/resources.qrc
@@ -121,6 +121,8 @@
assets/images/move_to_bottom_custom.svg
assets/images/new_call_custom.svg
assets/images/new_chat_group_custom.svg
+ assets/images/notifications_off_custom.svg
+ assets/images/notifications_on_custom.svg
assets/images/options_custom.svg
assets/images/outgoing_call_custom.svg
assets/images/panel_arrow_custom.svg
diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp
index 5f16d932d..be187e550 100644
--- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp
+++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -486,6 +487,14 @@ bool ChatRoomModel::isUpdating() const{
return getState() == LinphoneEnums::ChatRoomStateCreationPending || getState() == LinphoneEnums::ChatRoomStateTerminationPending;
}
+bool ChatRoomModel::isNotificationsEnabled() const{
+ auto id = getChatRoomId();
+ QSettings settings;
+ settings.beginGroup("chatrooms");
+ settings.beginGroup(id);
+ return settings.value("notifications", true).toBool();
+}
+
std::shared_ptr ChatRoomModel::getChatRoom(){
return mChatRoom;
}
@@ -601,6 +610,16 @@ void ChatRoomModel::enableMarkAsRead(const bool& enable){
emit markAsReadEnabledChanged();
}
}
+void ChatRoomModel::enableNotifications(const bool& enable){
+ if(enable != isNotificationsEnabled()){
+ auto id = getChatRoomId();
+ QSettings settings;
+ settings.beginGroup("chatrooms");
+ settings.beginGroup(id);
+ settings.setValue("notifications", enable);
+ notificationsEnabledChanged();
+ }
+}
void ChatRoomModel::setReply(ChatMessageModel * model){
if(model != mReplyModel.get()){
@@ -1166,6 +1185,20 @@ void ChatRoomModel::insertNotices (const QList& chatRoom){
+ auto localAddress = chatRoom->getLocalAddress()->clone();
+ localAddress->clean();
+ return getChatRoomId(Utils::coreStringToAppString(localAddress->asStringUriOnly()), (chatRoom->getPeerAddress() ? Utils::coreStringToAppString(chatRoom->getPeerAddress()->asStringUriOnly()) : ""));
+}
+
// -----------------------------------------------------------------------------
/*
void ChatRoomModel::removeUnreadMessagesNotice() {
diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.hpp b/linphone-app/src/components/chat-room/ChatRoomModel.hpp
index 4c25d05e6..e4bf25ecd 100644
--- a/linphone-app/src/components/chat-room/ChatRoomModel.hpp
+++ b/linphone-app/src/components/chat-room/ChatRoomModel.hpp
@@ -88,6 +88,7 @@ public:
Q_PROPERTY(bool ephemeralEnabled READ isEphemeralEnabled WRITE setEphemeralEnabled NOTIFY ephemeralEnabledChanged)
Q_PROPERTY(bool canBeEphemeral READ canBeEphemeral NOTIFY canBeEphemeralChanged)
Q_PROPERTY(bool markAsReadEnabled READ markAsReadEnabled WRITE enableMarkAsRead NOTIFY markAsReadEnabledChanged)
+ Q_PROPERTY(bool notificationsEnabled READ isNotificationsEnabled WRITE enableNotifications NOTIFY notificationsEnabledChanged)
Q_PROPERTY(ParticipantListModel* participants READ getParticipantListModel CONSTANT)
@@ -139,6 +140,7 @@ public:
bool isEntriesLoading() const;
bool isBasic() const;
bool isUpdating() const;
+ bool isNotificationsEnabled() const;
ParticipantListModel* getParticipantListModel() const;
std::list> getParticipants(const bool& withMe = true) const;
@@ -159,6 +161,7 @@ public:
void setEphemeralEnabled(bool enabled);
void setEphemeralLifetime(long lifetime);
void enableMarkAsRead(const bool& enable);
+ void enableNotifications(const bool& enable);
void setReply(ChatMessageModel * model);
ChatMessageModel * getReply()const;
@@ -206,6 +209,10 @@ public:
void insertNotice (const std::shared_ptr &enventLog);
void insertNotices (const QList> &eventLogs);
+ QString getChatRoomId()const;
+ static QString getChatRoomId(const QString& localAddress, const QString& remoteAddress);
+ static QString getChatRoomId(const std::shared_ptr& chatRoom); // For convenience
+
//-------------------- CHAT ROOM HANDLER
public slots:
@@ -279,6 +286,7 @@ signals:
void chatRoomDeleted();// Must be connected with DirectConnection mode
void replyChanged();
void updatingChanged();
+ void notificationsEnabledChanged();
// Chat Room listener callbacks
diff --git a/linphone-app/src/components/core/CoreHandlers.cpp b/linphone-app/src/components/core/CoreHandlers.cpp
index f00621f2e..ff3c83646 100644
--- a/linphone-app/src/components/core/CoreHandlers.cpp
+++ b/linphone-app/src/components/core/CoreHandlers.cpp
@@ -20,6 +20,7 @@
#include
#include
+#include
#include
#include
@@ -223,7 +224,9 @@ void CoreHandlers::onMessagesReceived (
SettingsModel *settingsModel = coreManager->getSettingsModel();
const App *app = App::getInstance();
QStringList notNotifyReasons;
+ QSettings appSettings;
+ appSettings.beginGroup("chatrooms");
for(auto message : messages){
if( !message || message->isOutgoing() )
continue;
@@ -235,7 +238,16 @@ void CoreHandlers::onMessagesReceived (
|| chatRoom->getCurrentParams()->getEncryptionBackend() != linphone::ChatRoomEncryptionBackend::None && !settingsModel->getSecureChatEnabled())
continue;
- // 2. Notify with Notification popup.
+ // 2. Do not notify if the chatroom's notification has been deactivated.
+ appSettings.beginGroup(ChatRoomModel::getChatRoomId(chatRoom));
+ if(!appSettings.value("notifications", true).toBool()){
+ appSettings.endGroup();
+ continue;
+ }else{
+ appSettings.endGroup();
+ }
+
+ // 3. Notify with Notification popup.
if (coreManager->getSettingsModel()->getChatNotificationsEnabled()
&& (!app->hasFocus() || !Utils::isMe(chatRoom->getLocalAddress()))
&& !message->isRead())// On aggregation, the list can contains already displayed messages.
diff --git a/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml b/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml
index f38e0cff1..eeb40741a 100644
--- a/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml
+++ b/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml
@@ -47,7 +47,10 @@ QtObject {
property QtObject scheduleMeeting: QtObject {
property string icon : 'meetings_custom'
}
-
+ property QtObject notifications: QtObject {
+ property string off : 'notifications_off_custom'
+ property string on : 'notifications_on_custom'
+ }
property QtObject contact: QtObject {
property string add : 'contact_add_custom'
property string view : 'contact_view_custom'
diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatMenu.qml b/linphone-app/ui/modules/Linphone/Chat/ChatMenu.qml
index 41feec40e..b0e190925 100644
--- a/linphone-app/ui/modules/Linphone/Chat/ChatMenu.qml
+++ b/linphone-app/ui/modules/Linphone/Chat/ChatMenu.qml
@@ -120,7 +120,7 @@ Item {
iconSizeMenu: MenuItemStyle.entry.iconSize
iconLayoutDirection: Qt.RightToLeft
menuItemStyle : MenuItemStyle.aux
- visible: !chatMessageModel.isOutgoing
+ visible: container.chatMessageModel && !container.chatMessageModel.isOutgoing
onTriggered: container.isContact ? container.viewContactClicked(container.chatMessageModel.fromSipAddress) : container.addContactClicked(container.chatMessageModel.fromSipAddress)
}
MenuItem {
diff --git a/linphone-app/ui/modules/Linphone/Contact/Contact.qml b/linphone-app/ui/modules/Linphone/Contact/Contact.qml
index 5dcc99f93..87458c9c8 100644
--- a/linphone-app/ui/modules/Linphone/Contact/Contact.qml
+++ b/linphone-app/ui/modules/Linphone/Contact/Contact.qml
@@ -50,7 +50,6 @@ Rectangle {
anchors {
fill: parent
leftMargin: ContactStyle.leftMargin
- rightMargin: ContactStyle.rightMargin
}
spacing: 0
@@ -138,11 +137,9 @@ Rectangle {
ContactMessageCounter {
Layout.alignment: Qt.AlignTop
-
- count: entry?Number(entry.unreadMessagesCount) + Number(entry.missedCallsCount):0
- isComposing: Boolean(entry && entry.composers && entry.composers.length > 0)
-
- visible: entry?(entry.unreadMessagesCount !== null || entry.missedCallsCount !== null) && item.displayUnreadMessageCount:false
+ Layout.preferredWidth: count > 0 && visible ? implicitWidth : 0
+ entry: item.entry
+ displayCounter: item.displayUnreadMessageCount
}
}
}
diff --git a/linphone-app/ui/modules/Linphone/Contact/ContactMessageCounter.qml b/linphone-app/ui/modules/Linphone/Contact/ContactMessageCounter.qml
index 06290e067..f52ae82f0 100644
--- a/linphone-app/ui/modules/Linphone/Contact/ContactMessageCounter.qml
+++ b/linphone-app/ui/modules/Linphone/Contact/ContactMessageCounter.qml
@@ -11,10 +11,13 @@ Item {
id: messageCounter
property alias count: counterIcon.count
- property bool isComposing
+ property var entry
+ property bool isComposing: Boolean(entry && entry.composers && entry.composers.length > 0)
+ property bool displayCounter: true
implicitHeight: counterIcon.height + ContactMessageCounterStyle.verticalMargins * 2
implicitWidth: counterIcon.width + ContactMessageCounterStyle.horizontalMargins * 2
+ visible: count > 0 ?(entry.unreadMessagesCount !== null || entry.missedCallsCount !== null) && displayCounter:false
MessageCounter {
id: counterIcon
@@ -27,6 +30,8 @@ Item {
? ('chat_is_composing_' + counterIcon.composingIndex)
: 'chat_count'
visible: messageCounter.count > 0 || messageCounter.isComposing
+
+ count: messageCounter.entry?Number(messageCounter.entry.unreadMessagesCount) + Number(messageCounter.entry.missedCallsCount):0
Timer {
interval: 500
diff --git a/linphone-app/ui/modules/Linphone/Styles/Contact/ContactMessageCounterStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Contact/ContactMessageCounterStyle.qml
index 18b121163..7f2b137ba 100644
--- a/linphone-app/ui/modules/Linphone/Styles/Contact/ContactMessageCounterStyle.qml
+++ b/linphone-app/ui/modules/Linphone/Styles/Contact/ContactMessageCounterStyle.qml
@@ -6,5 +6,5 @@ import QtQml 2.2
QtObject {
property int horizontalMargins: 0
- property int verticalMargins: 10
+ property int verticalMargins: 5
}
diff --git a/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml
index 1a4f5476a..2fa8a216e 100644
--- a/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml
+++ b/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml
@@ -9,6 +9,15 @@ import ColorsList 1.0
QtObject {
property string sectionName: 'Timeline'
property var colorModel: ColorsList.add(sectionName+'_bg', 'q')
+ property QtObject status: QtObject{
+ property int iconSize : 30
+ }
+
+ property QtObject disabledNotifications: QtObject{
+ property string icon: 'notifications_off_custom'
+ property var colorModel: ColorsList.addImageColor(sectionName+'_disabledNotifications', icon, 'ad')
+ property var selectedColorModel: ColorsList.addImageColor(sectionName+'_disabledNotifications_c', icon, 'q')
+ }
property QtObject ephemeralTimer: QtObject{
property string icon: 'timer_custom'
diff --git a/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml b/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml
index c0cbfc41c..5c37cc136 100644
--- a/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml
+++ b/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml
@@ -14,7 +14,7 @@ import 'Timeline.js' as Logic
import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
-Item {
+Rectangle {
id: mainItem
property TimelineModel timelineModel
property bool optionsToggled: false
@@ -46,61 +46,106 @@ Item {
]
enabled: !contactView.showBusyIndicator
-
- Contact {
- id: contactView
- property bool isSelected: mainItem.timelineModel != undefined && mainItem.timelineModel.selected //view.currentIndex === index
-
- height: mainItem.height
- width: mainItem.width
- color: isSelected
+ color: contactView.isSelected
? TimelineStyle.contact.backgroundColor.selected.color
: (
mainItem.modelIndex % 2 == 0
? TimelineStyle.contact.backgroundColor.a.color
: TimelineStyle.contact.backgroundColor.b.color
)
- displayUnreadMessageCount: SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled
- entry: mainItem.timelineModel && mainItem.timelineModel.chatRoomModel
-
- property var subtitleSelectedColors: TimelineStyle.contact.subtitle.color.selected
- property var subtitleNormalColors: TimelineStyle.contact.subtitle.color.normal
- property var titleSelectedColors: TimelineStyle.contact.title.color.selected
- property var titleNormalColors: TimelineStyle.contact.title.color.normal
-
- subtitleColor: isSelected
- ? subtitleSelectedColors.color
- : subtitleNormalColors.color
- titleColor: isSelected
- ? titleSelectedColors.color
- : titleNormalColors.color
- showSubtitle: mainItem.timelineModel && (mainItem.timelineModel.chatRoomModel && (mainItem.timelineModel.chatRoomModel.isOneToOne || !mainItem.timelineModel.chatRoomModel.isConference))
- showBusyIndicator: mainItem.timelineModel && mainItem.timelineModel.updating
- TooltipArea {
- id: contactTooltip
- text: mainItem.timelineModel && UtilsCpp.toDateTimeString(mainItem.timelineModel.chatRoomModel.lastUpdateTime)
- isClickable: true
+
+ RowLayout{
+ anchors.fill: parent
+ anchors.rightMargin: 5
+ spacing: 0
+ Contact {
+ id: contactView
+ property bool isSelected: mainItem.timelineModel != undefined && mainItem.timelineModel.selected //view.currentIndex === index
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ color: isSelected
+ ? TimelineStyle.contact.backgroundColor.selected.color
+ : (
+ mainItem.modelIndex % 2 == 0
+ ? TimelineStyle.contact.backgroundColor.a.color
+ : TimelineStyle.contact.backgroundColor.b.color
+ )
+ displayUnreadMessageCount: false
+ entry: mainItem.timelineModel && mainItem.timelineModel.chatRoomModel
+
+ property var subtitleSelectedColors: TimelineStyle.contact.subtitle.color.selected
+ property var subtitleNormalColors: TimelineStyle.contact.subtitle.color.normal
+ property var titleSelectedColors: TimelineStyle.contact.title.color.selected
+ property var titleNormalColors: TimelineStyle.contact.title.color.normal
+
+ subtitleColor: isSelected
+ ? subtitleSelectedColors.color
+ : subtitleNormalColors.color
+ titleColor: isSelected
+ ? titleSelectedColors.color
+ : titleNormalColors.color
+ showSubtitle: mainItem.timelineModel && (mainItem.timelineModel.chatRoomModel && (mainItem.timelineModel.chatRoomModel.isOneToOne || !mainItem.timelineModel.chatRoomModel.isConference))
+ showBusyIndicator: mainItem.timelineModel && mainItem.timelineModel.updating
+ TooltipArea {
+ id: contactTooltip
+ text: mainItem.timelineModel && UtilsCpp.toDateTimeString(mainItem.timelineModel.chatRoomModel.lastUpdateTime)
+ isClickable: true
+ }
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ propagateComposedEvents: true
+ preventStealing: false
+ onClicked: {
+ if(mouse.button == Qt.LeftButton){
+ mainItem.timelineModel.selected = true
+ }else{
+ mainItem.optionsToggled = !mainItem.optionsToggled
+ }
+ }
+ }
}
- Icon{
- icon: TimelineStyle.ephemeralTimer.icon
- iconSize: TimelineStyle.ephemeralTimer.iconSize
- overwriteColor: mainItem.timelineModel && mainItem.timelineModel.selected ? TimelineStyle.ephemeralTimer.selectedTimerColor.color : TimelineStyle.ephemeralTimer.timerColor.color
- anchors.right:parent.right
- anchors.bottom:parent.bottom
- anchors.bottomMargin: 7
- anchors.rightMargin: 7
- visible: mainItem.timelineModel && mainItem.timelineModel.chatRoomModel.ephemeralEnabled
- }
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- propagateComposedEvents: true
- preventStealing: false
- onClicked: {
- if(mouse.button == Qt.LeftButton){
- mainItem.timelineModel.selected = true
- }else{
- mainItem.optionsToggled = !mainItem.optionsToggled
+ ColumnLayout{
+ spacing: 0
+ Layout.maximumWidth: statusLayout.count > 0 || unreadMessageCounter.visible ? -1 : 0
+ Layout.fillHeight: true
+ RowLayout{
+ Layout.alignment: Qt.AlignTop | Qt.AlignRight
+ Layout.fillHeight: true
+ spacing: 0
+ ContactMessageCounter {
+ id: unreadMessageCounter
+ Layout.alignment: Qt.AlignTop
+ Layout.preferredWidth: implicitWidth
+ Layout.preferredHeight: implicitHeight
+ Layout.rightMargin: 9
+ displayCounter: SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled
+ entry: contactView.entry
+ }
+ }
+ RowLayout{
+ id: statusLayout
+ property int count : (ephemeralIcon.visible ? 1 : 0) + (notificationsIcon.visible ? 1 : 0)
+ spacing: 0
+ Layout.alignment: Qt.AlignBottom | Qt.AlignRight
+ Layout.preferredHeight: TimelineStyle.status.iconSize
+ Icon{
+ id: notificationsIcon
+ Layout.preferredHeight: TimelineStyle.status.iconSize
+ Layout.preferredWidth: TimelineStyle.status.iconSize
+ icon: TimelineStyle.disabledNotifications.icon
+ iconSize: TimelineStyle.status.iconSize
+ overwriteColor: mainItem.timelineModel && mainItem.timelineModel.selected ? TimelineStyle.disabledNotifications.selectedColorModel.color : TimelineStyle.disabledNotifications.colorModel.color
+ visible: mainItem.timelineModel && !mainItem.timelineModel.chatRoomModel.notificationsEnabled
+ }
+ Icon{
+ id: ephemeralIcon
+ Layout.preferredHeight: TimelineStyle.status.iconSize
+ Layout.preferredWidth: TimelineStyle.status.iconSize
+ icon: TimelineStyle.ephemeralTimer.icon
+ iconSize: TimelineStyle.status.iconSize
+ overwriteColor: mainItem.timelineModel && mainItem.timelineModel.selected ? TimelineStyle.ephemeralTimer.selectedTimerColor.color : TimelineStyle.ephemeralTimer.timerColor.color
+ visible: mainItem.timelineModel && mainItem.timelineModel.chatRoomModel.ephemeralEnabled
}
}
}
diff --git a/linphone-app/ui/modules/Linphone/qmldir b/linphone-app/ui/modules/Linphone/qmldir
index 6355ee26b..6953676c1 100644
--- a/linphone-app/ui/modules/Linphone/qmldir
+++ b/linphone-app/ui/modules/Linphone/qmldir
@@ -33,6 +33,7 @@ CodecsViewer 1.0 Codecs/CodecsViewer.qml
Avatar 1.0 Contact/Avatar.qml
Contact 1.0 Contact/Contact.qml
ContactDescription 1.0 Contact/ContactDescription.qml
+ContactMessageCounter 1.0 Contact/ContactMessageCounter.qml
SipAddressDialog 1.0 Dialog/SipAddressDialog.qml
MultimediaParametersDialog 1.0 Dialog/MultimediaParametersDialog.qml
diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml
index 586ef3156..ad967d74d 100644
--- a/linphone-app/ui/views/App/Main/Conversation.qml
+++ b/linphone-app/ui/views/App/Main/Conversation.qml
@@ -507,7 +507,28 @@ ColumnLayout {
height:visible ? 1 : 0
width:parent.width
color: ConversationStyle.menu.separatorColor.color
- visible: deleteMenuItem.visible && (contactMenu.visible || groupInfoMenu.visible || devicesMenuItem.visible || ephemeralMenuItem.visible || scheduleMeetingMenuItem.visible)
+ visible: muteMenuItem.visible && (contactMenu.visible || groupInfoMenu.visible || devicesMenuItem.visible || ephemeralMenuItem.visible || scheduleMeetingMenuItem.visible)
+ }
+ MenuItem{
+ id: muteMenuItem
+ text: chatRoomModel.notificationsEnabled
+ //: 'Disable notifications' : Item menu to disable chat's notifications
+ ? qsTr('conversationMenuDeactivate')
+ //: 'Enable notifications' : Item menu to enable chat's notifications
+ : qsTr('conversationMenuActivate')
+ iconMenu: chatRoomModel.notificationsEnabled ? MenuItemStyle.notifications.off : MenuItemStyle.notifications.on
+ iconSizeMenu: 40
+ menuItemStyle : MenuItemStyle.aux2
+ onTriggered: {
+ chatRoomModel.notificationsEnabled = !chatRoomModel.notificationsEnabled
+ }
+ }
+
+ Rectangle{
+ height:visible ? 1 : 0
+ width:parent.width
+ color: ConversationStyle.menu.separatorColor.color
+ visible: deleteMenuItem.visible && (contactMenu.visible || groupInfoMenu.visible || devicesMenuItem.visible || ephemeralMenuItem.visible || scheduleMeetingMenuItem.visible || muteMenuItem.visible)
}
MenuItem{
id: deleteMenuItem