mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Update API [skip ci]
This commit is contained in:
@@ -6,7 +6,7 @@ import SwiftSignalKit
|
||||
extension PeerStatusSettings {
|
||||
init(apiSettings: Api.PeerSettings) {
|
||||
switch apiSettings {
|
||||
case let .peerSettings(flags, geoDistance, requestChatTitle, requestChatDate, businessBotId, businessBotManageUrl, chargePaidMessageStars):
|
||||
case let .peerSettings(flags, geoDistance, requestChatTitle, requestChatDate, businessBotId, businessBotManageUrl, chargePaidMessageStars, registrationMonth, phoneCountry, locationCountry):
|
||||
var result = PeerStatusSettings.Flags()
|
||||
if (flags & (1 << 1)) != 0 {
|
||||
result.insert(.canAddContact)
|
||||
@@ -37,9 +37,25 @@ extension PeerStatusSettings {
|
||||
if let businessBotId {
|
||||
let businessBotPaused = (flags & (1 << 11)) != 0
|
||||
let businessBotCanReply = (flags & (1 << 12)) != 0
|
||||
managingBot = ManagingBot(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(businessBotId)), manageUrl: businessBotManageUrl, isPaused: businessBotPaused, canReply: businessBotCanReply)
|
||||
managingBot = ManagingBot(
|
||||
id: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(businessBotId)),
|
||||
manageUrl: businessBotManageUrl,
|
||||
isPaused: businessBotPaused,
|
||||
canReply: businessBotCanReply
|
||||
)
|
||||
}
|
||||
self = PeerStatusSettings(flags: result, geoDistance: geoDistance, requestChatTitle: requestChatTitle, requestChatDate: requestChatDate, requestChatIsChannel: (flags & (1 << 10)) != 0, managingBot: managingBot, paidMessageStars: chargePaidMessageStars.flatMap { StarsAmount(value: $0, nanos: 0) })
|
||||
self = PeerStatusSettings(
|
||||
flags: result,
|
||||
geoDistance: geoDistance,
|
||||
requestChatTitle: requestChatTitle,
|
||||
requestChatDate: requestChatDate,
|
||||
requestChatIsChannel: (flags & (1 << 10)) != 0,
|
||||
managingBot: managingBot,
|
||||
paidMessageStars: chargePaidMessageStars.flatMap { StarsAmount(value: $0, nanos: 0) },
|
||||
registrationDate: registrationMonth,
|
||||
phoneCountry: phoneCountry,
|
||||
locationCountry: locationCountry
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user