Update API [skip ci]

This commit is contained in:
Ilya Laktyushin
2025-02-18 10:09:58 +04:00
parent d465851677
commit d167aa4b0e
76 changed files with 510 additions and 266 deletions

View File

@@ -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
)
}
}
}