diff --git a/Sources/Integration/Session/Session+Contacts.swift b/Sources/Integration/Session/Session+Contacts.swift index 7bbe5254ab00b17b8053323586347ef819f10ff1..3a462dbeaffc3ac675bb685f960d4b62736dd52b 100644 --- a/Sources/Integration/Session/Session+Contacts.swift +++ b/Sources/Integration/Session/Session+Contacts.swift @@ -251,6 +251,7 @@ extension Session { contact.photo = nil contact.isRecent = false contact.marshaled = nil + contact.isBlocked = true contact.authStatus = .stranger contact.nickname = contact.username _ = try? dbManager.saveContact(contact) diff --git a/Sources/Integration/Session/Session.swift b/Sources/Integration/Session/Session.swift index 1dec54ded12e24b801769440f3542c769dcba565..317a4bae5c3facf4a31635d6080ede594eb40fd9 100644 --- a/Sources/Integration/Session/Session.swift +++ b/Sources/Integration/Session/Session.swift @@ -460,6 +460,12 @@ public final class Session: SessionType { return } + if let contact = try! dbManager.fetchContacts(.init(id: [request.0.leaderId])).first { + if contact.isBanned || contact.isBlocked { + return + } + } + DispatchQueue.global().async { [weak self] in self?.processGroupCreation(request.0, memberIds: request.1, welcome: request.2) }