Skip to content

Commit 989e1b4

Browse files
author
Isaac
committed
Fix live stream settings
1 parent a05e19e commit 989e1b4

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/LiveStreamSettingsScreen.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -926,9 +926,12 @@ final class LiveStreamSettingsScreenComponent: Component {
926926
)
927927
)),
928928
action: { [weak self] _ in
929-
guard let self, let controller = self.environment?.controller() as? LiveStreamSettingsScreen else {
929+
guard let self, let component = self.component, let controller = self.environment?.controller() as? LiveStreamSettingsScreen else {
930930
return
931931
}
932+
if case let .edit(_, displayExternalStream, _, _) = component.stateContext.mode {
933+
self.complete(rtmp: displayExternalStream)
934+
}
932935
controller.dismiss()
933936
}
934937
)),
@@ -1034,7 +1037,7 @@ final class LiveStreamSettingsScreenComponent: Component {
10341037
public class LiveStreamSettingsScreen: ViewControllerComponentContainer {
10351038
public enum Mode {
10361039
case create(sendAsPeerId: EnginePeer.Id?, isCustomTarget: Bool, privacy: EngineStoryPrivacy, allowComments: Bool, isForwardingDisabled: Bool, pin: Bool, paidMessageStars: Int64)
1037-
case edit(call: PresentationGroupCall, displayExternalStream: Bool)
1040+
case edit(call: PresentationGroupCall, displayExternalStream: Bool, allowComments: Bool, paidMessageStars: Int64)
10381041
}
10391042

10401043
public struct Result {
@@ -1388,16 +1391,16 @@ public class LiveStreamSettingsScreen: ViewControllerComponentContainer {
13881391
isForwardingDisabled = isForwardingDisabledValue
13891392
pin = pinValue
13901393
paidMessageStars = paidMessageStarsValue
1391-
case let .edit(callValue, callIsStreamValue):
1394+
case let .edit(callValue, callIsStreamValue, allowCommentsValue, paidMessageStarsValue):
13921395
call = callValue
13931396
isEdit = true
13941397
sendAsPeerId = nil
13951398
isCustomTarget = false
13961399
privacy = EngineStoryPrivacy(base: .everyone, additionallyIncludePeers: [])
1397-
allowComments = true
1400+
allowComments = allowCommentsValue
13981401
isForwardingDisabled = false
13991402
pin = true
1400-
paidMessageStars = 0
1403+
paidMessageStars = paidMessageStarsValue
14011404
callIsStream = callIsStreamValue
14021405
}
14031406
}

submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4402,7 +4402,12 @@ final class StoryItemSetContainerSendMessage: @unchecked(Sendable) {
44024402

44034403
let stateContext = LiveStreamSettingsScreen.StateContext(
44044404
context: component.context,
4405-
mode: .edit(call: mediaStreamCall, displayExternalStream: callState.isUnifiedStream),
4405+
mode: .edit(
4406+
call: mediaStreamCall,
4407+
displayExternalStream: callState.isUnifiedStream,
4408+
allowComments: callState.messagesAreEnabled,
4409+
paidMessageStars: callState.sendPaidMessageStars ?? 0
4410+
),
44064411
closeFriends: .single([]),
44074412
adminedChannels: .single([]),
44084413
blockedPeersContext: nil

0 commit comments

Comments
 (0)