mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-07-10 01:48:35 +02:00
Update Ghostgram features
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
|
||||
|
||||
sgdeps = [
|
||||
"//Swiftgram/SGSimpleSettings:SGSimpleSettings",
|
||||
"//submodules/TranslateUI:TranslateUI"
|
||||
]
|
||||
|
||||
swift_library(
|
||||
name = "ChatMessageItemImpl",
|
||||
module_name = "ChatMessageItemImpl",
|
||||
@@ -9,7 +14,7 @@ swift_library(
|
||||
copts = [
|
||||
"-warnings-as-errors",
|
||||
],
|
||||
deps = [
|
||||
deps = sgdeps + [
|
||||
"//submodules/Postbox",
|
||||
"//submodules/AsyncDisplayKit",
|
||||
"//submodules/Display",
|
||||
|
||||
+17
-4
@@ -1,3 +1,5 @@
|
||||
import SGSimpleSettings
|
||||
import TranslateUI
|
||||
import Foundation
|
||||
import UIKit
|
||||
import Postbox
|
||||
@@ -327,14 +329,14 @@ public final class ChatMessageItemImpl: ChatMessageItem, CustomStringConvertible
|
||||
}
|
||||
displayAuthorInfo = incoming && peerId.isGroupOrChannel && effectiveAuthor != nil
|
||||
|
||||
if let channel = content.firstMessage.peers[content.firstMessage.id.peerId] as? TelegramChannel, channel.isForumOrMonoForum {
|
||||
if let chatPeer = content.firstMessage.peers[content.firstMessage.id.peerId], chatPeer.isForumOrMonoForum {
|
||||
if case .replyThread = chatLocation {
|
||||
if channel.isMonoForum && chatLocation.threadId != context.account.peerId.toInt64() {
|
||||
if chatPeer.isMonoForum && chatLocation.threadId != context.account.peerId.toInt64() {
|
||||
displayAuthorInfo = false
|
||||
}
|
||||
} else {
|
||||
if channel.isMonoForum {
|
||||
if let linkedMonoforumId = channel.linkedMonoforumId, let mainChannel = content.firstMessage.peers[linkedMonoforumId] as? TelegramChannel, mainChannel.hasPermission(.manageDirect) {
|
||||
if chatPeer.isMonoForum {
|
||||
if let chatPeer = chatPeer as? TelegramChannel, let linkedMonoforumId = chatPeer.linkedMonoforumId, let mainChannel = content.firstMessage.peers[linkedMonoforumId] as? TelegramChannel, mainChannel.hasPermission(.manageDirect) {
|
||||
headerSeparableThreadId = content.firstMessage.threadId
|
||||
|
||||
if let threadId = content.firstMessage.threadId, let peer = content.firstMessage.peers[EnginePeer.Id(threadId)] {
|
||||
@@ -533,6 +535,17 @@ public final class ChatMessageItemImpl: ChatMessageItem, CustomStringConvertible
|
||||
|
||||
let configure = {
|
||||
let node = (viewClassName as! ChatMessageItemView.Type).init(rotated: self.controllerInteraction.chatIsRotated)
|
||||
if let node = node as? ChatMessageStickerItemNode {
|
||||
node.sizeCoefficient = Float(SGSimpleSettings.shared.stickerSize) / 100.0
|
||||
if !SGSimpleSettings.shared.stickerTimestamp {
|
||||
node.dateAndStatusNode.isHidden = true
|
||||
}
|
||||
} else if let node = node as? ChatMessageAnimatedStickerItemNode {
|
||||
node.sizeCoefficient = Float(SGSimpleSettings.shared.stickerSize) / 100.0
|
||||
if !SGSimpleSettings.shared.stickerTimestamp {
|
||||
node.dateAndStatusNode.isHidden = true
|
||||
}
|
||||
}
|
||||
node.setupItem(self, synchronousLoad: synchronousLoads)
|
||||
|
||||
let nodeLayout = node.asyncLayout()
|
||||
|
||||
Reference in New Issue
Block a user