Skip to content

Commit c0ae0f8

Browse files
committed
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
2 parents 7e2d79a + cbab90d commit c0ae0f8

File tree

6 files changed

+27
-13
lines changed

6 files changed

+27
-13
lines changed

submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,14 @@ public final class MessageInputPanelComponent: Component {
178178
public var isExpanded: Bool
179179
public var isEmpty: Bool
180180
public var hasUnseenMessages: Bool
181+
public var isUnifiedStream: Bool
181182

182-
public init(isEnabled: Bool, isExpanded: Bool, isEmpty: Bool, hasUnseenMessages: Bool) {
183+
public init(isEnabled: Bool, isExpanded: Bool, isEmpty: Bool, hasUnseenMessages: Bool, isUnifiedStream: Bool) {
183184
self.isEnabled = isEnabled
184185
self.isExpanded = isExpanded
185186
self.isEmpty = isEmpty
186187
self.hasUnseenMessages = hasUnseenMessages
188+
self.isUnifiedStream = isUnifiedStream
187189
}
188190
}
189191

@@ -1065,7 +1067,7 @@ public final class MessageInputPanelComponent: Component {
10651067
rightAction = ChatTextInputPanelComponent.RightAction(kind: .empty, action: { _ in })
10661068
}
10671069
var secondaryRightAction: ChatTextInputPanelComponent.RightAction?
1068-
if component.isEmbeddedInCamera, let call = component.call {
1070+
if component.isEmbeddedInCamera, let call = component.call, let liveChatState = component.liveChatState, !liveChatState.isUnifiedStream {
10691071
secondaryRightAction = ChatTextInputPanelComponent.RightAction(kind: .liveMicrophone(call: call), action: { [weak self] sourceView in
10701072
guard let self, let component = self.component else {
10711073
return

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/StoryContentLiveChatComponent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ final class StoryContentLiveChatComponent: Component {
421421
}
422422

423423
var items: [ContextMenuItem] = []
424-
if !isPinned {
424+
if !isPinned, let messagesState = self.messagesState, let message = messagesState.messages.first(where: { $0.id == id }), !message.text.isEmpty {
425425
items.append(.action(ContextMenuActionItem(text: presentationData.strings.Conversation_ContextMenuCopy, textColor: .primary, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Copy"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in
426426
guard let self else {
427427
return

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ final class StoryItemContentComponent: Component {
119119
var starStats: StarStats?
120120
var isAdmin: Bool
121121
var defaultSendAs: EnginePeer.Id?
122+
var isUnifiedStream: Bool
122123

123-
init(isExpanded: Bool, isEmpty: Bool, hasUnseenMessages: Bool, areMessagesEnabled: Bool, minMessagePrice: Int64?, starStats: StarStats?, isAdmin: Bool, defaultSendAs: EnginePeer.Id?) {
124+
init(isExpanded: Bool, isEmpty: Bool, hasUnseenMessages: Bool, areMessagesEnabled: Bool, minMessagePrice: Int64?, starStats: StarStats?, isAdmin: Bool, defaultSendAs: EnginePeer.Id?, isUnifiedStream: Bool) {
124125
self.isExpanded = isExpanded
125126
self.isEmpty = isEmpty
126127
self.hasUnseenMessages = hasUnseenMessages
@@ -129,6 +130,7 @@ final class StoryItemContentComponent: Component {
129130
self.starStats = starStats
130131
self.isAdmin = isAdmin
131132
self.defaultSendAs = defaultSendAs
133+
self.isUnifiedStream = isUnifiedStream
132134
}
133135
}
134136

@@ -238,7 +240,8 @@ final class StoryItemContentComponent: Component {
238240
minMessagePrice: mediaStreamCallState?.minMessagePrice,
239241
starStats: starStats,
240242
isAdmin: mediaStreamCallState?.isAdmin ?? false,
241-
defaultSendAs: mediaStreamCallState?.defaultSendAs
243+
defaultSendAs: mediaStreamCallState?.defaultSendAs,
244+
isUnifiedStream: mediaStreamCallState?.isUnifiedStream ?? false
242245
)
243246
}
244247

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3006,10 +3006,11 @@ public final class StoryItemSetContainerComponent: Component {
30063006
if let visibleItemView = self.visibleItems[component.slice.item.id]?.view.view as? StoryItemContentComponent.View {
30073007
if let liveChatStateValue = visibleItemView.liveChatState {
30083008
liveChatState = MessageInputPanelComponent.LiveChatState(
3009-
isEnabled: liveChatStateValue.areMessagesEnabled,
3009+
isEnabled: liveChatStateValue.areMessagesEnabled || liveChatStateValue.isAdmin,
30103010
isExpanded: liveChatStateValue.isExpanded,
30113011
isEmpty: liveChatStateValue.isEmpty,
3012-
hasUnseenMessages: liveChatStateValue.hasUnseenMessages
3012+
hasUnseenMessages: liveChatStateValue.hasUnseenMessages,
3013+
isUnifiedStream: liveChatStateValue.isUnifiedStream
30133014
)
30143015
starStats = liveChatStateValue.starStats.flatMap { starStats in
30153016
return MessageInputPanelComponent.StarStats(

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)