mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Video Chats Improvements
This commit is contained in:
@@ -1905,7 +1905,9 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
|> mapToSignal { event -> Signal<PresentationGroupCallMemberEvent, NoError> in
|
||||
return postbox.transaction { transaction -> Signal<PresentationGroupCallMemberEvent, NoError> in
|
||||
if let peer = transaction.getPeer(event.peerId) {
|
||||
return .single(PresentationGroupCallMemberEvent(peer: peer, joined: event.joined))
|
||||
let isContact = transaction.isPeerContact(peerId: event.peerId)
|
||||
let isInChatList = transaction.getPeerChatListIndex(event.peerId) != nil
|
||||
return .single(PresentationGroupCallMemberEvent(peer: peer, isContact: isContact, isInChatList: isInChatList, canUnmute: event.canUnmute, joined: event.joined))
|
||||
} else {
|
||||
return .complete()
|
||||
}
|
||||
@@ -1913,13 +1915,20 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
|> switchToLatest
|
||||
}
|
||||
|> deliverOnMainQueue).start(next: { [weak self] event in
|
||||
guard let strongSelf = self else {
|
||||
guard let strongSelf = self, event.peer.id != strongSelf.stateValue.myPeerId else {
|
||||
return
|
||||
}
|
||||
if event.peer.id == strongSelf.stateValue.myPeerId {
|
||||
return
|
||||
var skip = false
|
||||
if let participantsCount = strongSelf.participantsContext?.immediateState?.totalCount, participantsCount >= 250 {
|
||||
if event.peer.isVerified || event.isContact || event.isInChatList || (strongSelf.stateValue.defaultParticipantMuteState == .muted && event.canUnmute) {
|
||||
skip = false
|
||||
} else {
|
||||
skip = true
|
||||
}
|
||||
}
|
||||
if !skip {
|
||||
strongSelf.memberEventsPipe.putNext(event)
|
||||
}
|
||||
strongSelf.memberEventsPipe.putNext(event)
|
||||
}))
|
||||
|
||||
if let isCurrentlyConnecting = self.isCurrentlyConnecting, isCurrentlyConnecting {
|
||||
|
||||
Reference in New Issue
Block a user