mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various Fixes
This commit is contained in:
BIN
Telegram/Telegram-iOS/Resources/Devices.tgs
Normal file
BIN
Telegram/Telegram-iOS/Resources/Devices.tgs
Normal file
Binary file not shown.
@@ -240,7 +240,8 @@ public func legacyAttachmentMenu(context: AccountContext, peer: Peer, chatLocati
|
|||||||
allItems.append(currentItem)
|
allItems.append(currentItem)
|
||||||
}
|
}
|
||||||
for item in allItems {
|
for item in allItems {
|
||||||
if let asset = item as? TGMediaAsset, asset.uniformTypeIdentifier.contains("heic") {
|
if item is TGCameraCapturedVideo {
|
||||||
|
} else if let asset = item as? TGMediaAsset, asset.uniformTypeIdentifier.contains("heic") {
|
||||||
hasHeic = true
|
hasHeic = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ private enum RecentSessionsEntry: ItemListNodeEntry {
|
|||||||
let arguments = arguments as! RecentSessionsControllerArguments
|
let arguments = arguments as! RecentSessionsControllerArguments
|
||||||
switch self {
|
switch self {
|
||||||
case let .header(_, text):
|
case let .header(_, text):
|
||||||
return RecentSessionsHeaderItem(context: arguments.context, theme: presentationData.theme, text: text, animationName: "Requests", sectionId: self.section, buttonAction: {
|
return RecentSessionsHeaderItem(context: arguments.context, theme: presentationData.theme, text: text, animationName: "Devices", sectionId: self.section, buttonAction: {
|
||||||
arguments.addDevice()
|
arguments.addDevice()
|
||||||
}, linkAction: { action in
|
}, linkAction: { action in
|
||||||
if case let .tap(link) = action {
|
if case let .tap(link) = action {
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class RecentSessionsHeaderItemNode: ListViewItemNode {
|
|||||||
return (layout, { [weak self] in
|
return (layout, { [weak self] in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
if strongSelf.item == nil {
|
if strongSelf.item == nil {
|
||||||
strongSelf.animationNode.setup(source: AnimatedStickerNodeLocalFileSource(name: item.animationName), width: 192, height: 192, playbackMode: .loop, mode: .direct(cachePathPrefix: nil))
|
strongSelf.animationNode.setup(source: AnimatedStickerNodeLocalFileSource(name: item.animationName), width: 192, height: 192, playbackMode: .once, mode: .direct(cachePathPrefix: nil))
|
||||||
strongSelf.animationNode.visibility = true
|
strongSelf.animationNode.visibility = true
|
||||||
}
|
}
|
||||||
strongSelf.item = item
|
strongSelf.item = item
|
||||||
|
|||||||
@@ -683,22 +683,10 @@ func enqueueMessages(transaction: Transaction, account: Account, peerId: PeerId,
|
|||||||
attributes.append(contentsOf: filterMessageAttributesForOutgoingMessage(sourceMessage.attributes))
|
attributes.append(contentsOf: filterMessageAttributesForOutgoingMessage(sourceMessage.attributes))
|
||||||
}
|
}
|
||||||
|
|
||||||
let authorId: PeerId?
|
|
||||||
if let peer = peer as? TelegramChannel {
|
|
||||||
if case .broadcast = peer.info {
|
|
||||||
authorId = peer.id
|
|
||||||
} else if case .group = peer.info, peer.hasPermission(.canBeAnonymous) {
|
|
||||||
authorId = peer.id
|
|
||||||
} else {
|
|
||||||
authorId = account.peerId
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
authorId = account.peerId
|
|
||||||
}
|
|
||||||
|
|
||||||
var messageNamespace = Namespaces.Message.Local
|
var messageNamespace = Namespaces.Message.Local
|
||||||
var entitiesAttribute: TextEntitiesMessageAttribute?
|
var entitiesAttribute: TextEntitiesMessageAttribute?
|
||||||
var effectiveTimestamp = timestamp
|
var effectiveTimestamp = timestamp
|
||||||
|
var sendAsPeer: Peer?
|
||||||
var threadId: Int64?
|
var threadId: Int64?
|
||||||
for attribute in attributes {
|
for attribute in attributes {
|
||||||
if let attribute = attribute as? TextEntitiesMessageAttribute {
|
if let attribute = attribute as? TextEntitiesMessageAttribute {
|
||||||
@@ -713,8 +701,27 @@ func enqueueMessages(transaction: Transaction, account: Account, peerId: PeerId,
|
|||||||
if let threadMessageId = attribute.threadMessageId {
|
if let threadMessageId = attribute.threadMessageId {
|
||||||
threadId = makeMessageThreadId(threadMessageId)
|
threadId = makeMessageThreadId(threadMessageId)
|
||||||
}
|
}
|
||||||
|
} else if let attribute = attribute as? SendAsMessageAttribute {
|
||||||
|
if let peer = transaction.getPeer(attribute.peerId) {
|
||||||
|
sendAsPeer = peer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let authorId: PeerId?
|
||||||
|
if let sendAsPeer = sendAsPeer {
|
||||||
|
authorId = sendAsPeer.id
|
||||||
|
} else if let peer = peer as? TelegramChannel {
|
||||||
|
if case .broadcast = peer.info {
|
||||||
|
authorId = peer.id
|
||||||
|
} else if case .group = peer.info, peer.hasPermission(.canBeAnonymous) {
|
||||||
|
authorId = peer.id
|
||||||
|
} else {
|
||||||
|
authorId = account.peerId
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
authorId = account.peerId
|
||||||
|
}
|
||||||
|
|
||||||
if messageNamespace != Namespaces.Message.ScheduledLocal {
|
if messageNamespace != Namespaces.Message.ScheduledLocal {
|
||||||
attributes.removeAll(where: { $0 is OutgoingScheduleInfoMessageAttribute })
|
attributes.removeAll(where: { $0 is OutgoingScheduleInfoMessageAttribute })
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ private func canEditMessage(accountPeerId: PeerId, limitsConfiguration: LimitsCo
|
|||||||
}
|
}
|
||||||
} else if message.id.peerId.namespace == Namespaces.Peer.SecretChat || message.id.namespace != Namespaces.Message.Cloud {
|
} else if message.id.peerId.namespace == Namespaces.Peer.SecretChat || message.id.namespace != Namespaces.Message.Cloud {
|
||||||
hasEditRights = false
|
hasEditRights = false
|
||||||
|
} else if let author = message.author, author.id.namespace == Namespaces.Peer.CloudChannel && message.id.peerId.namespace == Namespaces.Peer.CloudChannel, !message.flags.contains(.Incoming) {
|
||||||
|
hasEditRights = true
|
||||||
} else if let author = message.author, author.id == accountPeerId, let peer = message.peers[message.id.peerId] {
|
} else if let author = message.author, author.id == accountPeerId, let peer = message.peers[message.id.peerId] {
|
||||||
hasEditRights = true
|
hasEditRights = true
|
||||||
if let peer = peer as? TelegramChannel {
|
if let peer = peer as? TelegramChannel {
|
||||||
|
|||||||
@@ -993,7 +993,7 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
|
|
||||||
var allowAuthor = incoming
|
var allowAuthor = incoming
|
||||||
|
|
||||||
if let author = firstMessage.author, author is TelegramChannel, author.id == firstMessage.id.peerId, !incoming {
|
if let author = firstMessage.author, author is TelegramChannel, !incoming {
|
||||||
allowAuthor = true
|
allowAuthor = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2168,14 +2168,19 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
|
|
||||||
if let nameNode = nameNodeSizeApply.1() {
|
if let nameNode = nameNodeSizeApply.1() {
|
||||||
strongSelf.nameNode = nameNode
|
strongSelf.nameNode = nameNode
|
||||||
|
nameNode.displaysAsynchronously = !item.presentationData.isPreview && !item.presentationData.theme.theme.forceSync
|
||||||
|
|
||||||
|
let previousNameNodeFrame = nameNode.frame
|
||||||
|
let nameNodeFrame = CGRect(origin: CGPoint(x: contentOrigin.x + layoutConstants.text.bubbleInsets.left, y: layoutConstants.bubble.contentInsets.top + nameNodeOriginY), size: nameNodeSizeApply.0)
|
||||||
|
nameNode.frame = nameNodeFrame
|
||||||
if nameNode.supernode == nil {
|
if nameNode.supernode == nil {
|
||||||
if !nameNode.isNodeLoaded {
|
if !nameNode.isNodeLoaded {
|
||||||
nameNode.isUserInteractionEnabled = false
|
nameNode.isUserInteractionEnabled = false
|
||||||
}
|
}
|
||||||
strongSelf.clippingNode.addSubnode(nameNode)
|
strongSelf.clippingNode.addSubnode(nameNode)
|
||||||
|
} else {
|
||||||
|
transition.animatePositionAdditive(node: nameNode, offset: CGPoint(x: previousNameNodeFrame.maxX - nameNodeFrame.maxX, y: 0.0))
|
||||||
}
|
}
|
||||||
nameNode.frame = CGRect(origin: CGPoint(x: contentOrigin.x + layoutConstants.text.bubbleInsets.left, y: layoutConstants.bubble.contentInsets.top + nameNodeOriginY), size: nameNodeSizeApply.0)
|
|
||||||
nameNode.displaysAsynchronously = !item.presentationData.isPreview && !item.presentationData.theme.theme.forceSync
|
|
||||||
|
|
||||||
if let credibilityIconImage = currentCredibilityIconImage {
|
if let credibilityIconImage = currentCredibilityIconImage {
|
||||||
let credibilityIconNode: ASImageNode
|
let credibilityIconNode: ASImageNode
|
||||||
|
|||||||
Reference in New Issue
Block a user