Stars subscriptions

This commit is contained in:
Ilya Laktyushin
2024-08-06 22:40:17 +02:00
parent 4a0d46047c
commit df311bb022
36 changed files with 767 additions and 239 deletions

View File

@@ -87,34 +87,35 @@ func chatHistoryEntriesForView(
if (associatedData.subject?.isService ?? false) {
} else {
if case let .peer(peerId) = location, case let cachedData = cachedData as? CachedChannelData, let invitedOn = cachedData?.invitedOn {
joinMessage = Message(
stableId: UInt32.max - 1000,
stableVersion: 0,
id: MessageId(peerId: peerId, namespace: Namespaces.Message.Local, id: 0),
globallyUniqueId: nil,
groupingKey: nil,
groupInfo: nil,
threadId: nil,
timestamp: invitedOn,
flags: [.Incoming],
tags: [],
globalTags: [],
localTags: [],
customTags: [],
forwardInfo: nil,
author: channelPeer,
text: "",
attributes: [],
media: [TelegramMediaAction(action: .joinedByRequest)],
peers: SimpleDictionary<PeerId, Peer>(),
associatedMessages: SimpleDictionary<MessageId, Message>(),
associatedMessageIds: [],
associatedMedia: [:],
associatedThreadInfo: nil,
associatedStories: [:]
)
} else if let peer = channelPeer as? TelegramChannel, case .broadcast = peer.info, case .member = peer.participationStatus, !peer.flags.contains(.isCreator) {
// if case let .peer(peerId) = location, case let cachedData = cachedData as? CachedChannelData, let invitedOn = cachedData?.invitedOn {
// joinMessage = Message(
// stableId: UInt32.max - 1000,
// stableVersion: 0,
// id: MessageId(peerId: peerId, namespace: Namespaces.Message.Local, id: 0),
// globallyUniqueId: nil,
// groupingKey: nil,
// groupInfo: nil,
// threadId: nil,
// timestamp: invitedOn,
// flags: [.Incoming],
// tags: [],
// globalTags: [],
// localTags: [],
// customTags: [],
// forwardInfo: nil,
// author: channelPeer,
// text: "",
// attributes: [],
// media: [TelegramMediaAction(action: .joinedByRequest)],
// peers: SimpleDictionary<PeerId, Peer>(),
// associatedMessages: SimpleDictionary<MessageId, Message>(),
// associatedMessageIds: [],
// associatedMedia: [:],
// associatedThreadInfo: nil,
// associatedStories: [:]
// )
// } else
if let peer = channelPeer as? TelegramChannel, case .broadcast = peer.info, case .member = peer.participationStatus, !peer.flags.contains(.isCreator) {
joinMessage = Message(
stableId: UInt32.max - 1000,
stableVersion: 0,