fix isVideoEnabled

This commit is contained in:
overtake 2021-05-04 20:31:12 +03:00
parent bfcbf98931
commit 4fa93eae22

View File

@ -382,19 +382,19 @@ public enum GetGroupCallParticipantsError {
}
public func getGroupCallParticipants(account: Account, callId: Int64, accessHash: Int64, offset: String, ssrcs: [UInt32], limit: Int32, sortAscending: Bool?) -> Signal<GroupCallParticipantsContext.State, GetGroupCallParticipantsError> {
let sortAscendingValue: Signal<(Bool, Int32?, Bool, GroupCallParticipantsContext.State.DefaultParticipantsAreMuted?), GetGroupCallParticipantsError>
let sortAscendingValue: Signal<(Bool, Int32?, Bool, GroupCallParticipantsContext.State.DefaultParticipantsAreMuted?, Bool), GetGroupCallParticipantsError>
if let sortAscending = sortAscending {
sortAscendingValue = .single((sortAscending, nil, false, nil))
sortAscendingValue = .single((sortAscending, nil, false, nil, false))
} else {
sortAscendingValue = getCurrentGroupCall(account: account, callId: callId, accessHash: accessHash)
|> mapError { _ -> GetGroupCallParticipantsError in
return .generic
}
|> mapToSignal { result -> Signal<(Bool, Int32?, Bool, GroupCallParticipantsContext.State.DefaultParticipantsAreMuted?), GetGroupCallParticipantsError> in
|> mapToSignal { result -> Signal<(Bool, Int32?, Bool, GroupCallParticipantsContext.State.DefaultParticipantsAreMuted?, Bool), GetGroupCallParticipantsError> in
guard let result = result else {
return .fail(.generic)
}
return .single((result.info.sortAscending, result.info.scheduleTimestamp, result.info.subscribedToScheduled, result.info.defaultParticipantsAreMuted))
return .single((result.info.sortAscending, result.info.scheduleTimestamp, result.info.subscribedToScheduled, result.info.defaultParticipantsAreMuted, result.info.isVideoEnabled))
}
}
@ -412,7 +412,8 @@ public func getGroupCallParticipants(account: Account, callId: Int64, accessHash
let version: Int32
let nextParticipantsFetchOffset: String?
let (sortAscendingValue, scheduleTimestamp, subscribedToScheduled, defaultParticipantsAreMuted) = sortAscendingAndScheduleTimestamp
let (sortAscendingValue, scheduleTimestamp, subscribedToScheduled, defaultParticipantsAreMuted, isVideoEnabled) = sortAscendingAndScheduleTimestamp
switch result {
case let .groupParticipants(count, participants, nextOffset, chats, users, apiVersion):
@ -510,7 +511,7 @@ public func getGroupCallParticipants(account: Account, callId: Int64, accessHash
scheduleTimestamp: scheduleTimestamp,
subscribedToScheduled: subscribedToScheduled,
totalCount: totalCount,
isVideoEnabled: false,
isVideoEnabled: isVideoEnabled,
version: version
)
}