mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Update API [skip ci]
This commit is contained in:
parent
aed1467617
commit
cba5b9b5e1
@ -15,6 +15,7 @@ public struct PeerStatusSettings: PostboxCoding, Equatable {
|
||||
public static let addExceptionWhenAddingContact = Flags(rawValue: 1 << 5)
|
||||
public static let canReportIrrelevantGeoLocation = Flags(rawValue: 1 << 6)
|
||||
public static let autoArchived = Flags(rawValue: 1 << 7)
|
||||
public static let suggestAddMembers = Flags(rawValue: 1 << 8)
|
||||
|
||||
}
|
||||
|
||||
|
@ -361,10 +361,10 @@ private final class PeerExportedInvitationsContextImpl {
|
||||
var lastResult = self.results.last
|
||||
|
||||
if self.forceUpdate {
|
||||
self.populateCache = true
|
||||
self.forceUpdate = false
|
||||
lastResult = nil
|
||||
}
|
||||
if !self.forceUpdate && self.loadedFromCache {
|
||||
} else if self.loadedFromCache {
|
||||
self.populateCache = false
|
||||
self.loadedFromCache = false
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public func removeGroupAdmin(account: Account, peerId: PeerId, adminId: PeerId)
|
||||
public enum AddGroupAdminError {
|
||||
case generic
|
||||
case addMemberError(AddGroupMemberError)
|
||||
case adminsTooMuch
|
||||
}
|
||||
|
||||
public func addGroupAdmin(account: Account, peerId: PeerId, adminId: PeerId) -> Signal<Void, AddGroupAdminError> {
|
||||
@ -79,6 +80,8 @@ public func addGroupAdmin(account: Account, peerId: PeerId, adminId: PeerId) ->
|
||||
)
|
||||
} else if error.errorDescription == "USER_PRIVACY_RESTRICTED" {
|
||||
return .fail(.addMemberError(.privacy))
|
||||
} else if error.errorDescription == "ADMINS_TOO_MUCH" {
|
||||
return .fail(.adminsTooMuch)
|
||||
}
|
||||
return .fail(.generic)
|
||||
}
|
||||
@ -121,6 +124,7 @@ public func addGroupAdmin(account: Account, peerId: PeerId, adminId: PeerId) ->
|
||||
public enum UpdateChannelAdminRightsError {
|
||||
case generic
|
||||
case addMemberError(AddChannelMemberError)
|
||||
case adminsTooMuch
|
||||
}
|
||||
|
||||
public func fetchChannelParticipant(account: Account, peerId: PeerId, participantId: PeerId) -> Signal<ChannelParticipant?, NoError> {
|
||||
@ -203,6 +207,8 @@ public func updateChannelAdminRights(account: Account, peerId: PeerId, adminId:
|
||||
return .fail(.addMemberError(.restricted))
|
||||
} else if error.errorDescription == "USER_CHANNELS_TOO_MUCH" {
|
||||
return .fail(.addMemberError(.tooMuchJoined))
|
||||
} else if error.errorDescription == "ADMINS_TOO_MUCH" {
|
||||
return .fail(.adminsTooMuch)
|
||||
}
|
||||
return .fail(.generic)
|
||||
}
|
||||
|
@ -30,6 +30,9 @@ extension PeerStatusSettings {
|
||||
if (flags & (1 << 7)) != 0 {
|
||||
result.insert(.autoArchived)
|
||||
}
|
||||
if (flags & (1 << 8)) != 0 {
|
||||
result.insert(.suggestAddMembers)
|
||||
}
|
||||
self = PeerStatusSettings(flags: result, geoDistance: geoDistance)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user