mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various Fixes
This commit is contained in:
parent
92c06c45b2
commit
e67b193c73
@ -5978,3 +5978,9 @@ Sorry for the inconvenience.";
|
|||||||
"VoiceOver.Chat.Profile" = "Profile";
|
"VoiceOver.Chat.Profile" = "Profile";
|
||||||
"VoiceOver.Chat.GroupInfo" = "Group Info";
|
"VoiceOver.Chat.GroupInfo" = "Group Info";
|
||||||
"VoiceOver.Chat.ChannelInfo" = "Channel Info";
|
"VoiceOver.Chat.ChannelInfo" = "Channel Info";
|
||||||
|
|
||||||
|
"Conversation.ForwardTooltip.Chat.One" = "Message forwarded to **%@**";
|
||||||
|
"Conversation.ForwardTooltip.Chat.Many" = "Messages forwarded to **%@**";
|
||||||
|
|
||||||
|
"Conversation.ForwardTooltip.SavedMessages.One" = "Message forwarded to **Saved Messages**";
|
||||||
|
"Conversation.ForwardTooltip.SavedMessages.Many" = "Messages forwarded to **Saved Messages**";
|
||||||
|
@ -29,6 +29,7 @@ import GalleryData
|
|||||||
import InstantPageUI
|
import InstantPageUI
|
||||||
import ChatInterfaceState
|
import ChatInterfaceState
|
||||||
import ShareController
|
import ShareController
|
||||||
|
import UndoUI
|
||||||
|
|
||||||
private enum ChatListTokenId: Int32 {
|
private enum ChatListTokenId: Int32 {
|
||||||
case filter
|
case filter
|
||||||
@ -899,6 +900,9 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
|||||||
let peerId = peer.id
|
let peerId = peer.id
|
||||||
if let strongSelf = self, let _ = peerSelectionController {
|
if let strongSelf = self, let _ = peerSelectionController {
|
||||||
if peerId == strongSelf.context.account.peerId {
|
if peerId == strongSelf.context.account.peerId {
|
||||||
|
let presentationData = strongSelf.context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
(strongSelf.navigationController?.topViewController as? ViewController)?.present(UndoOverlayController(presentationData: presentationData, content: .forward(savedMessages: true, text: messages.count == 1 ? presentationData.strings.Conversation_ForwardTooltip_SavedMessages_One : presentationData.strings.Conversation_ForwardTooltip_SavedMessages_Many), elevatedLayout: false, animateInAsReplacement: false, action: { _ in return false }), in: .window(.root))
|
||||||
|
|
||||||
let _ = (enqueueMessages(account: strongSelf.context.account, peerId: peerId, messages: messageIds.map { id -> EnqueueMessage in
|
let _ = (enqueueMessages(account: strongSelf.context.account, peerId: peerId, messages: messageIds.map { id -> EnqueueMessage in
|
||||||
return .forward(source: id, grouping: .auto, attributes: [])
|
return .forward(source: id, grouping: .auto, attributes: [])
|
||||||
})
|
})
|
||||||
|
@ -7,6 +7,22 @@ struct KeyboardSurface {
|
|||||||
let host: UIView
|
let host: UIView
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public extension UIResponder {
|
||||||
|
private struct Static {
|
||||||
|
static weak var responder: UIResponder?
|
||||||
|
}
|
||||||
|
|
||||||
|
static func currentFirst() -> UIResponder? {
|
||||||
|
Static.responder = nil
|
||||||
|
UIApplication.shared.sendAction(#selector(UIResponder._trap), to: nil, from: nil, for: nil)
|
||||||
|
return Static.responder
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc private func _trap() {
|
||||||
|
Static.responder = self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func getFirstResponder(_ view: UIView) -> UIView? {
|
private func getFirstResponder(_ view: UIView) -> UIView? {
|
||||||
if view.isFirstResponder {
|
if view.isFirstResponder {
|
||||||
return view
|
return view
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -10041,6 +10041,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
strongSelf.searchResultsController = nil
|
strongSelf.searchResultsController = nil
|
||||||
strongController.dismiss()
|
strongController.dismiss()
|
||||||
} else if peerId == strongSelf.context.account.peerId {
|
} else if peerId == strongSelf.context.account.peerId {
|
||||||
|
let presentationData = strongSelf.context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
strongSelf.present(UndoOverlayController(presentationData: presentationData, content: .forward(savedMessages: true, text: messages.count == 1 ? presentationData.strings.Conversation_ForwardTooltip_SavedMessages_One : presentationData.strings.Conversation_ForwardTooltip_SavedMessages_Many), elevatedLayout: false, animateInAsReplacement: false, action: { _ in return false }), in: .window(.root))
|
||||||
|
|
||||||
let _ = (enqueueMessages(account: strongSelf.context.account, peerId: peerId, messages: messages.map { message -> EnqueueMessage in
|
let _ = (enqueueMessages(account: strongSelf.context.account, peerId: peerId, messages: messages.map { message -> EnqueueMessage in
|
||||||
return .forward(source: message.id, grouping: .auto, attributes: [])
|
return .forward(source: message.id, grouping: .auto, attributes: [])
|
||||||
})
|
})
|
||||||
@ -11262,7 +11265,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
} else {
|
} else if UIResponder.currentFirst() == nil {
|
||||||
inputShortcuts = [
|
inputShortcuts = [
|
||||||
KeyShortcut(title: strings.KeyCommand_FocusOnInputField, input: "\r", action: { [weak self] in
|
KeyShortcut(title: strings.KeyCommand_FocusOnInputField, input: "\r", action: { [weak self] in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
@ -11316,6 +11319,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
} else {
|
||||||
|
inputShortcuts = []
|
||||||
}
|
}
|
||||||
|
|
||||||
var canEdit = false
|
var canEdit = false
|
||||||
|
@ -54,6 +54,7 @@ import GalleryData
|
|||||||
import ChatInterfaceState
|
import ChatInterfaceState
|
||||||
import TelegramVoip
|
import TelegramVoip
|
||||||
import InviteLinksUI
|
import InviteLinksUI
|
||||||
|
import UndoUI
|
||||||
|
|
||||||
protocol PeerInfoScreenItem: class {
|
protocol PeerInfoScreenItem: class {
|
||||||
var id: AnyHashable { get }
|
var id: AnyHashable { get }
|
||||||
@ -4689,6 +4690,9 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
|||||||
|
|
||||||
if let strongSelf = self, let _ = peerSelectionController {
|
if let strongSelf = self, let _ = peerSelectionController {
|
||||||
if peerId == strongSelf.context.account.peerId {
|
if peerId == strongSelf.context.account.peerId {
|
||||||
|
let presentationData = strongSelf.context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
strongSelf.controller?.present(UndoOverlayController(presentationData: presentationData, content: .forward(savedMessages: true, text: messageIds.count == 1 ? presentationData.strings.Conversation_ForwardTooltip_SavedMessages_One : presentationData.strings.Conversation_ForwardTooltip_SavedMessages_Many), elevatedLayout: false, animateInAsReplacement: false, action: { _ in return false }), in: .window(.root))
|
||||||
|
|
||||||
strongSelf.headerNode.navigationButtonContainer.performAction?(.selectionDone)
|
strongSelf.headerNode.navigationButtonContainer.performAction?(.selectionDone)
|
||||||
|
|
||||||
let _ = (enqueueMessages(account: strongSelf.context.account, peerId: peerId, messages: messageIds.map { id -> EnqueueMessage in
|
let _ = (enqueueMessages(account: strongSelf.context.account, peerId: peerId, messages: messageIds.map { id -> EnqueueMessage in
|
||||||
|
@ -174,7 +174,7 @@ final class YoutubeEmbedImplementation: WebEmbedImplementation {
|
|||||||
updateStatus(self.status)
|
updateStatus(self.status)
|
||||||
|
|
||||||
let html = String(format: htmlTemplate, paramsJson)
|
let html = String(format: htmlTemplate, paramsJson)
|
||||||
webView.loadHTMLString(html, baseURL: URL(string: "https://messenger.telegram.org"))
|
webView.loadHTMLString(html, baseURL: URL(string: "https://telegram.youtube.com"))
|
||||||
// webView.isUserInteractionEnabled = false
|
// webView.isUserInteractionEnabled = false
|
||||||
|
|
||||||
userContentController.addUserScript(WKUserScript(source: userScript, injectionTime: .atDocumentEnd, forMainFrameOnly: false))
|
userContentController.addUserScript(WKUserScript(source: userScript, injectionTime: .atDocumentEnd, forMainFrameOnly: false))
|
||||||
|
@ -28,6 +28,7 @@ public enum UndoOverlayContent {
|
|||||||
case banned(text: String)
|
case banned(text: String)
|
||||||
case importedMessage(text: String)
|
case importedMessage(text: String)
|
||||||
case audioRate(slowdown: Bool, text: String)
|
case audioRate(slowdown: Bool, text: String)
|
||||||
|
case forward(savedMessages: Bool, text: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum UndoOverlayAction {
|
public enum UndoOverlayAction {
|
||||||
|
@ -492,6 +492,21 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode {
|
|||||||
self.textNode.attributedText = attributedText
|
self.textNode.attributedText = attributedText
|
||||||
self.textNode.maximumNumberOfLines = 2
|
self.textNode.maximumNumberOfLines = 2
|
||||||
|
|
||||||
|
displayUndo = false
|
||||||
|
self.originalRemainingSeconds = 3
|
||||||
|
case let .forward(savedMessages, text):
|
||||||
|
self.avatarNode = nil
|
||||||
|
self.iconNode = nil
|
||||||
|
self.iconCheckNode = nil
|
||||||
|
self.animationNode = AnimationNode(animation: savedMessages ? "anim_savedmessages" : "anim_forward", colors: [:], scale: 0.066)
|
||||||
|
self.animatedStickerNode = nil
|
||||||
|
|
||||||
|
let body = MarkdownAttributeSet(font: Font.regular(14.0), textColor: .white)
|
||||||
|
let bold = MarkdownAttributeSet(font: Font.semibold(14.0), textColor: .white)
|
||||||
|
let attributedText = parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(body: body, bold: bold, link: body, linkAttribute: { _ in return nil }), textAlignment: .natural)
|
||||||
|
self.textNode.attributedText = attributedText
|
||||||
|
self.textNode.maximumNumberOfLines = 2
|
||||||
|
|
||||||
displayUndo = false
|
displayUndo = false
|
||||||
self.originalRemainingSeconds = 3
|
self.originalRemainingSeconds = 3
|
||||||
}
|
}
|
||||||
@ -522,7 +537,7 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode {
|
|||||||
switch content {
|
switch content {
|
||||||
case .removedChat:
|
case .removedChat:
|
||||||
self.panelWrapperNode.addSubnode(self.timerTextNode)
|
self.panelWrapperNode.addSubnode(self.timerTextNode)
|
||||||
case .archivedChat, .hidArchive, .revealedArchive, .succeed, .emoji, .swipeToReply, .actionSucceeded, .stickersModified, .chatAddedToFolder, .chatRemovedFromFolder, .messagesUnpinned, .setProximityAlert, .invitedToVoiceChat, .linkCopied, .banned, .importedMessage, .audioRate:
|
case .archivedChat, .hidArchive, .revealedArchive, .succeed, .emoji, .swipeToReply, .actionSucceeded, .stickersModified, .chatAddedToFolder, .chatRemovedFromFolder, .messagesUnpinned, .setProximityAlert, .invitedToVoiceChat, .linkCopied, .banned, .importedMessage, .audioRate, .forward:
|
||||||
break
|
break
|
||||||
case .dice:
|
case .dice:
|
||||||
self.panelWrapperNode.clipsToBounds = true
|
self.panelWrapperNode.clipsToBounds = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user