feat: Implement user blocking check in MessageRepository and ChatViewModel to ignore messages from blocked users
This commit is contained in:
@@ -200,6 +200,12 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
|
||||
val privateKey = myPrivateKey ?: return@launch
|
||||
val account = myPublicKey ?: return@launch
|
||||
|
||||
// 🔥 Проверяем блокировку (как в Архиве)
|
||||
val isBlocked = database.blacklistDao().isUserBlocked(packet.fromPublicKey, account)
|
||||
if (isBlocked) {
|
||||
Log.d(TAG, "🚫 BLOCKED: Ignoring message from blocked user ${packet.fromPublicKey.take(20)}...")
|
||||
return@launch
|
||||
}
|
||||
|
||||
// Расшифровываем в фоне - получаем и текст и plainKeyAndNonce
|
||||
val decryptResult = MessageCrypto.decryptIncomingFull(
|
||||
|
||||
Reference in New Issue
Block a user