mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 17:43:18 +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:
|
||||
build:
|
||||
runs-on: macos-10.15
|
||||
runs-on: macos-11
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -17,7 +17,7 @@ jobs:
|
||||
fetch-depth: '0'
|
||||
|
||||
- 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
|
||||
run: |
|
||||
|
||||
@ -30,7 +30,7 @@ objc_library(
|
||||
]),
|
||||
copts = [
|
||||
"-I{}/PublicHeaders/LegacyComponents".format(package_name()),
|
||||
"-Werror",
|
||||
#"-Werror",
|
||||
],
|
||||
includes = [
|
||||
"PublicHeaders",
|
||||
|
||||
@ -322,7 +322,7 @@ const CGFloat TGPhotoEditorSliderViewInternalMargin = 7.0f;
|
||||
|
||||
#pragma mark - Properties
|
||||
|
||||
- (bool)isTracking
|
||||
- (BOOL)isTracking
|
||||
{
|
||||
return _knobView.highlighted;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
@implementation UICollectionView (TGTransitioning)
|
||||
|
||||
- (BOOL)isTransitionInProgress
|
||||
- (bool)isTransitionInProgress
|
||||
{
|
||||
return ([self tg_transitionData] != nil);
|
||||
}
|
||||
|
||||
@ -549,8 +549,11 @@ public extension TelegramEngine {
|
||||
}
|
||||
}
|
||||
|
||||
guard let peerGroupId = transaction.getPeerChatListIndex(peerId)?.0 else {
|
||||
return nil
|
||||
let peerGroupId: PeerGroupId
|
||||
if let peerGroupIdValue = transaction.getPeerChatListIndex(peerId)?.0 {
|
||||
peerGroupId = peerGroupIdValue
|
||||
} else {
|
||||
peerGroupId = .root
|
||||
}
|
||||
|
||||
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))
|
||||
}
|
||||
|
||||
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()
|
||||
} else {
|
||||
let _ = (ApplicationSpecificNotice.getBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: message.id.peerId)
|
||||
} else if let botPeer = botPeer {
|
||||
let _ = (ApplicationSpecificNotice.getBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: botPeer.id)
|
||||
|> deliverOnMainQueue).start(next: { value in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
|
||||
if value {
|
||||
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: {
|
||||
if let strongSelf = self {
|
||||
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 {
|
||||
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>
|
||||
if let current = self.overscrollView {
|
||||
overscrollView = current
|
||||
@ -1271,21 +1271,23 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
}
|
||||
|
||||
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 >= 0.99
|
||||
let currentType = expandProgress >= 0.99
|
||||
let previousType = self.currentOverscrollExpandProgress >= 1.0
|
||||
let currentType = expandProgress >= 1.0
|
||||
|
||||
if previousType != currentType {
|
||||
if self.feedback == nil {
|
||||
self.feedback = HapticFeedback()
|
||||
}
|
||||
if let _ = nextChannelToRead {
|
||||
self.feedback?.tap()
|
||||
} else {
|
||||
self.feedback?.success()
|
||||
}
|
||||
}
|
||||
|
||||
self.currentOverscrollExpandProgress = expandProgress
|
||||
}
|
||||
|
||||
if let nextChannelToRead = self.nextChannelToRead {
|
||||
let swipeText: (String, [(Int, NSRange)])
|
||||
@ -1307,7 +1309,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
|
||||
if expandProgress < 0.1 {
|
||||
chatControllerNode.setChatInputPanelOverscrollNode(overscrollNode: nil)
|
||||
} else if expandProgress >= 0.99 {
|
||||
} else if expandProgress >= 1.0 {
|
||||
if chatControllerNode.inputPanelOverscrollNode?.text.0 != releaseText.0 {
|
||||
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",
|
||||
"xcode": "12.5.1"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user