mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[WIP] Stories
This commit is contained in:
@@ -37,6 +37,30 @@ public class ReplyMessageAttribute: MessageAttribute {
|
||||
}
|
||||
}
|
||||
|
||||
public class ReplyStoryAttribute: MessageAttribute {
|
||||
public let storyId: StoryId
|
||||
|
||||
public var associatedStoryIds: [StoryId] {
|
||||
return [self.storyId]
|
||||
}
|
||||
|
||||
public var associatedPeerIds: [PeerId] {
|
||||
return [self.storyId.peerId]
|
||||
}
|
||||
|
||||
public init(storyId: StoryId) {
|
||||
self.storyId = storyId
|
||||
}
|
||||
|
||||
required public init(decoder: PostboxDecoder) {
|
||||
self.storyId = decoder.decode(StoryId.self, forKey: "i") ?? StoryId(peerId: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(1)), id: 1)
|
||||
}
|
||||
|
||||
public func encode(_ encoder: PostboxEncoder) {
|
||||
encoder.encode(self.storyId, forKey: "i")
|
||||
}
|
||||
}
|
||||
|
||||
public extension Message {
|
||||
var effectiveReplyThreadMessageId: MessageId? {
|
||||
if let threadId = self.threadId {
|
||||
|
||||
Reference in New Issue
Block a user