[WIP] Privacy update

This commit is contained in:
Isaac
2024-01-05 10:55:59 +04:00
parent f27952b7c2
commit fb517e49c9
68 changed files with 4913 additions and 3974 deletions

View File

@@ -417,6 +417,17 @@ public extension Message {
}
return nil
}
var effectiveReactionsAttribute: ReactionsMessageAttribute? {
if !self.hasReactions {
return nil
}
if let result = mergedMessageReactions(attributes: self.attributes) {
return result
} else {
return nil
}
}
var effectiveReactions: [MessageReaction]? {
if !self.hasReactions {
return nil
@@ -476,6 +487,19 @@ public extension Message {
}
}
public extension Message {
func areReactionsTags(accountPeerId: PeerId) -> Bool {
if self.id.peerId == accountPeerId {
if let reactionsAttribute = self.reactionsAttribute, !reactionsAttribute.reactions.isEmpty {
return reactionsAttribute.isTags
} else {
return true
}
}
return false
}
}
public func _internal_parseMediaAttachment(data: Data) -> Media? {
guard let object = Api.parse(Buffer(buffer: MemoryBuffer(data: data))) else {
return nil