mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 09:32:46 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
5c0d7177ce
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -8,7 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: macos-10.15
|
runs-on: macos-11
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -17,7 +17,7 @@ jobs:
|
|||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Set active Xcode path
|
- name: Set active Xcode path
|
||||||
run: sudo xcode-select -s /Applications/Xcode_12.4.app/Contents/Developer
|
run: sudo xcode-select -s /Applications/Xcode_12.5.1.app/Contents/Developer
|
||||||
|
|
||||||
- name: Create canonical source directory
|
- name: Create canonical source directory
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@ -30,7 +30,7 @@ objc_library(
|
|||||||
]),
|
]),
|
||||||
copts = [
|
copts = [
|
||||||
"-I{}/PublicHeaders/LegacyComponents".format(package_name()),
|
"-I{}/PublicHeaders/LegacyComponents".format(package_name()),
|
||||||
"-Werror",
|
#"-Werror",
|
||||||
],
|
],
|
||||||
includes = [
|
includes = [
|
||||||
"PublicHeaders",
|
"PublicHeaders",
|
||||||
|
|||||||
@ -322,7 +322,7 @@ const CGFloat TGPhotoEditorSliderViewInternalMargin = 7.0f;
|
|||||||
|
|
||||||
#pragma mark - Properties
|
#pragma mark - Properties
|
||||||
|
|
||||||
- (bool)isTracking
|
- (BOOL)isTracking
|
||||||
{
|
{
|
||||||
return _knobView.highlighted;
|
return _knobView.highlighted;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
@implementation UICollectionView (TGTransitioning)
|
@implementation UICollectionView (TGTransitioning)
|
||||||
|
|
||||||
- (BOOL)isTransitionInProgress
|
- (bool)isTransitionInProgress
|
||||||
{
|
{
|
||||||
return ([self tg_transitionData] != nil);
|
return ([self tg_transitionData] != nil);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -549,8 +549,11 @@ public extension TelegramEngine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
guard let peerGroupId = transaction.getPeerChatListIndex(peerId)?.0 else {
|
let peerGroupId: PeerGroupId
|
||||||
return nil
|
if let peerGroupIdValue = transaction.getPeerChatListIndex(peerId)?.0 {
|
||||||
|
peerGroupId = peerGroupIdValue
|
||||||
|
} else {
|
||||||
|
peerGroupId = .root
|
||||||
}
|
}
|
||||||
|
|
||||||
if let filterId = chatListFilterId {
|
if let filterId = chatListFilterId {
|
||||||
|
|||||||
@ -1284,17 +1284,34 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
strongSelf.effectiveNavigationController?.pushViewController(GameController(context: strongSelf.context, url: url, message: message))
|
strongSelf.effectiveNavigationController?.pushViewController(GameController(context: strongSelf.context, url: url, message: message))
|
||||||
}
|
}
|
||||||
|
|
||||||
if let botPeer = message.author as? TelegramUser, botPeer.flags.contains(.isVerified) {
|
var botPeer: TelegramUser?
|
||||||
|
for attribute in message.attributes {
|
||||||
|
if let attribute = attribute as? InlineBotMessageAttribute {
|
||||||
|
if let peerId = attribute.peerId {
|
||||||
|
botPeer = message.peers[peerId] as? TelegramUser
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if botPeer == nil {
|
||||||
|
if let peer = message.author as? TelegramUser, peer.botInfo != nil {
|
||||||
|
botPeer = peer
|
||||||
|
} else if let peer = message.peers[message.id.peerId] as? TelegramUser, peer.botInfo != nil {
|
||||||
|
botPeer = peer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if let botPeer = botPeer, botPeer.flags.contains(.isVerified) {
|
||||||
openBot()
|
openBot()
|
||||||
} else {
|
} else if let botPeer = botPeer {
|
||||||
let _ = (ApplicationSpecificNotice.getBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: message.id.peerId)
|
let _ = (ApplicationSpecificNotice.getBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: botPeer.id)
|
||||||
|> deliverOnMainQueue).start(next: { value in
|
|> deliverOnMainQueue).start(next: { value in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if value {
|
if value {
|
||||||
openBot()
|
openBot()
|
||||||
} else if let botPeer = message.author as? TelegramUser {
|
} else {
|
||||||
strongSelf.present(textAlertController(context: strongSelf.context, title: nil, text: strongSelf.presentationData.strings.Conversation_BotInteractiveUrlAlert(botPeer.displayTitle(strings: strongSelf.presentationData.strings, displayOrder: strongSelf.presentationData.nameDisplayOrder)).string, actions: [TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { }), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {
|
strongSelf.present(textAlertController(context: strongSelf.context, title: nil, text: strongSelf.presentationData.strings.Conversation_BotInteractiveUrlAlert(botPeer.displayTitle(strings: strongSelf.presentationData.strings, displayOrder: strongSelf.presentationData.nameDisplayOrder)).string, actions: [TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { }), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
let _ = ApplicationSpecificNotice.setBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: botPeer.id).start()
|
let _ = ApplicationSpecificNotice.setBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: botPeer.id).start()
|
||||||
|
|||||||
@ -1259,7 +1259,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||||||
if self.freezeOverscrollControl {
|
if self.freezeOverscrollControl {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if let offset = offset, offset < 0.0, self.offerNextChannelToRead, let chatControllerNode = self.controllerInteraction.chatControllerNode() as? ChatControllerNode, chatControllerNode.shouldAllowOverscrollActions {
|
if let offset = offset, offset < -0.1, self.offerNextChannelToRead, let chatControllerNode = self.controllerInteraction.chatControllerNode() as? ChatControllerNode, chatControllerNode.shouldAllowOverscrollActions {
|
||||||
let overscrollView: ComponentHostView<Empty>
|
let overscrollView: ComponentHostView<Empty>
|
||||||
if let current = self.overscrollView {
|
if let current = self.overscrollView {
|
||||||
overscrollView = current
|
overscrollView = current
|
||||||
@ -1271,22 +1271,24 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let expandDistance = max(-offset - 12.0, 0.0)
|
let expandDistance = max(-offset - 12.0, 0.0)
|
||||||
let expandProgress: CGFloat = min(1.0, expandDistance / 90.0)
|
let expandProgress: CGFloat = min(1.0, expandDistance / 94.0)
|
||||||
|
|
||||||
if let _ = nextChannelToRead {
|
let previousType = self.currentOverscrollExpandProgress >= 1.0
|
||||||
let previousType = self.currentOverscrollExpandProgress >= 0.99
|
let currentType = expandProgress >= 1.0
|
||||||
let currentType = expandProgress >= 0.99
|
|
||||||
|
|
||||||
if previousType != currentType {
|
if previousType != currentType {
|
||||||
if self.feedback == nil {
|
if self.feedback == nil {
|
||||||
self.feedback = HapticFeedback()
|
self.feedback = HapticFeedback()
|
||||||
}
|
}
|
||||||
self.feedback?.tap()
|
if let _ = nextChannelToRead {
|
||||||
|
self.feedback?.tap()
|
||||||
|
} else {
|
||||||
|
self.feedback?.success()
|
||||||
}
|
}
|
||||||
|
|
||||||
self.currentOverscrollExpandProgress = expandProgress
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.currentOverscrollExpandProgress = expandProgress
|
||||||
|
|
||||||
if let nextChannelToRead = self.nextChannelToRead {
|
if let nextChannelToRead = self.nextChannelToRead {
|
||||||
let swipeText: (String, [(Int, NSRange)])
|
let swipeText: (String, [(Int, NSRange)])
|
||||||
let releaseText: (String, [(Int, NSRange)])
|
let releaseText: (String, [(Int, NSRange)])
|
||||||
@ -1307,7 +1309,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||||||
|
|
||||||
if expandProgress < 0.1 {
|
if expandProgress < 0.1 {
|
||||||
chatControllerNode.setChatInputPanelOverscrollNode(overscrollNode: nil)
|
chatControllerNode.setChatInputPanelOverscrollNode(overscrollNode: nil)
|
||||||
} else if expandProgress >= 0.99 {
|
} else if expandProgress >= 1.0 {
|
||||||
if chatControllerNode.inputPanelOverscrollNode?.text.0 != releaseText.0 {
|
if chatControllerNode.inputPanelOverscrollNode?.text.0 != releaseText.0 {
|
||||||
chatControllerNode.setChatInputPanelOverscrollNode(overscrollNode: ChatInputPanelOverscrollNode(text: releaseText, color: self.currentPresentationData.theme.theme.rootController.navigationBar.secondaryTextColor, priority: 1))
|
chatControllerNode.setChatInputPanelOverscrollNode(overscrollNode: ChatInputPanelOverscrollNode(text: releaseText, color: self.currentPresentationData.theme.theme.rootController.navigationBar.secondaryTextColor, priority: 1))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit b5a053d60ab96a2f7857135adef4f1a9e8cfe775
|
Subproject commit dc8c87e75bb88acb51dfdd781db2f8bcf1fb7433
|
||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"app": "7.9.1",
|
"app": "8.0",
|
||||||
"bazel": "4.0.0",
|
"bazel": "4.0.0",
|
||||||
"xcode": "12.5.1"
|
"xcode": "12.5.1"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user