mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 12:25:19 +00:00
Improve private message notification behavior
- Don't show PM notifications when the private chat is already open - Store peer ID in notification userInfo for reliable chat opening - Tap notification to open the correct private chat using peer ID - Check both in ChatViewModel (when receiving) and NotificationDelegate (when presenting)
This commit is contained in:
@@ -1968,7 +1968,10 @@ extension ChatViewModel: BitchatDelegate {
|
||||
if isMentioned && message.sender != nickname {
|
||||
NotificationService.shared.sendMentionNotification(from: message.sender, message: message.content)
|
||||
} else if message.isPrivate && message.sender != nickname {
|
||||
NotificationService.shared.sendPrivateMessageNotification(from: message.sender, message: message.content)
|
||||
// Only send notification if the private chat is not currently open
|
||||
if selectedPrivateChatPeer != message.senderPeerID {
|
||||
NotificationService.shared.sendPrivateMessageNotification(from: message.sender, message: message.content, peerID: message.senderPeerID ?? "")
|
||||
}
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
|
||||
Reference in New Issue
Block a user