mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Do not play sound for currently displayed conversation if message is outgoing or read
This commit is contained in:
parent
7d6c50cf29
commit
fb323a4606
1 changed files with 12 additions and 2 deletions
|
|
@ -270,9 +270,19 @@ class NotificationsManager
|
|||
val id = LinphoneUtils.getConversationId(chatRoom)
|
||||
if (currentlyDisplayedChatRoomId.isNotEmpty() && id == currentlyDisplayedChatRoomId) {
|
||||
Log.i(
|
||||
"$TAG Do not notify received messages for currently displayed conversation [$id] but play sound"
|
||||
"$TAG Do not notify received messages for currently displayed conversation [$id], but play sound if at least one message is incoming and not read"
|
||||
)
|
||||
playMessageReceivedSound()
|
||||
|
||||
var playSound = false
|
||||
for (message in messages) {
|
||||
if (!message.isOutgoing && !message.isRead) {
|
||||
playSound = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (playSound) {
|
||||
playMessageReceivedSound()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue