mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Implement copy restriction and send as peer
This commit is contained in:
@@ -52,6 +52,9 @@ func parseTelegramGroupOrChannel(chat: Api.Chat) -> Peer? {
|
||||
if (flags & Int32(1 << 24)) != 0 {
|
||||
groupFlags.insert(.hasActiveVoiceChat)
|
||||
}
|
||||
if (flags & Int32(1 << 25)) != 0 {
|
||||
groupFlags.insert(.copyProtectionEnabled)
|
||||
}
|
||||
return TelegramGroup(id: PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id)), title: title, photo: imageRepresentationsForApiChatPhoto(photo), participantCount: Int(participantsCount), role: role, membership: left ? .Left : .Member, flags: groupFlags, defaultBannedRights: defaultBannedRights.flatMap(TelegramChatBannedRights.init(apiBannedRights:)), migrationReference: migrationReference, creationDate: date, version: Int(version))
|
||||
case let .chatEmpty(id):
|
||||
return TelegramGroup(id: PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id)), title: "", photo: [], participantCount: 0, role: .member, membership: .Removed, flags: [], defaultBannedRights: nil, migrationReference: nil, creationDate: 0, version: 0)
|
||||
@@ -84,9 +87,6 @@ func parseTelegramGroupOrChannel(chat: Api.Chat) -> Peer? {
|
||||
if (flags & Int32(1 << 20)) != 0 {
|
||||
infoFlags.insert(.hasDiscussionGroup)
|
||||
}
|
||||
if (flags & Int32(1 << 27)) != 0 {
|
||||
infoFlags.insert(.copyProtectionEnabled)
|
||||
}
|
||||
info = .broadcast(TelegramChannelBroadcastInfo(flags: infoFlags))
|
||||
}
|
||||
|
||||
@@ -115,6 +115,9 @@ func parseTelegramGroupOrChannel(chat: Api.Chat) -> Peer? {
|
||||
if (flags & Int32(1 << 26)) != 0 {
|
||||
channelFlags.insert(.isGigagroup)
|
||||
}
|
||||
if (flags & Int32(1 << 27)) != 0 {
|
||||
channelFlags.insert(.copyProtectionEnabled)
|
||||
}
|
||||
|
||||
let restrictionInfo: PeerAccessRestrictionInfo?
|
||||
if let restrictionReason = restrictionReason {
|
||||
|
||||
Reference in New Issue
Block a user