mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge commit '095a6a45adadf5404d50aa15e2c22133b34fd243'
This commit is contained in:
commit
8eaf939a92
@ -1093,6 +1093,13 @@ public final class GroupCallParticipantsContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func updateMuteState(peerId: PeerId, muteState: Participant.MuteState?, volume: Int32?) {
|
public func updateMuteState(peerId: PeerId, muteState: Participant.MuteState?, volume: Int32?) {
|
||||||
|
|
||||||
|
var muteState = muteState
|
||||||
|
if muteState == nil, let _ = volume {
|
||||||
|
muteState = self.stateValue.overlayState.pendingMuteStateChanges[peerId]?.state
|
||||||
|
?? self.stateValue.state.participants.first(where: { $0.peer.id == peerId })?.muteState
|
||||||
|
}
|
||||||
|
|
||||||
if let current = self.stateValue.overlayState.pendingMuteStateChanges[peerId] {
|
if let current = self.stateValue.overlayState.pendingMuteStateChanges[peerId] {
|
||||||
if current.state == muteState {
|
if current.state == muteState {
|
||||||
return
|
return
|
||||||
@ -1128,10 +1135,12 @@ public final class GroupCallParticipantsContext {
|
|||||||
return .single(nil)
|
return .single(nil)
|
||||||
}
|
}
|
||||||
var flags: Int32 = 0
|
var flags: Int32 = 0
|
||||||
if let muteState = muteState, (!muteState.canUnmute || peerId == account.peerId || muteState.mutedByYou) {
|
if let _ = volume {
|
||||||
flags |= 1 << 0
|
|
||||||
} else if let _ = volume {
|
|
||||||
flags |= 1 << 1
|
flags |= 1 << 1
|
||||||
|
} else {
|
||||||
|
if let muteState = muteState, (!muteState.canUnmute || peerId == account.peerId || muteState.mutedByYou) {
|
||||||
|
flags |= 1 << 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return account.network.request(Api.functions.phone.editGroupCallMember(flags: flags, call: .inputGroupCall(id: id, accessHash: accessHash), userId: inputUser, volume: volume))
|
return account.network.request(Api.functions.phone.editGroupCallMember(flags: flags, call: .inputGroupCall(id: id, accessHash: accessHash), userId: inputUser, volume: volume))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user