Added wallpapers reset method

This commit is contained in:
Ilya Laktyushin 2019-01-28 00:05:19 +03:00
parent 8d2692faeb
commit cdd24aff03
2 changed files with 29 additions and 5 deletions

View File

@ -5153,6 +5153,20 @@ extension Api {
return result
})
}
static func resetWallPapers() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
let buffer = Buffer()
buffer.appendInt32(-1153722364)
return (FunctionDescription(name: "account.resetWallPapers", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in
let reader = BufferReader(buffer)
var result: Api.Bool?
if let signature = reader.readInt32() {
result = Api.parse(reader, signature: signature) as? Api.Bool
}
return result
})
}
}
struct langpack {
static func getLangPack(langPack: String, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.LangPackDifference>) {

View File

@ -203,3 +203,13 @@ public func installWallpaper(account: Account, wallpaper: TelegramWallpaper) ->
return .complete()
}
}
public func resetWallpapers(account: Account) -> Signal<Void, NoError> {
return account.network.request(Api.functions.account.resetWallPapers())
|> `catch` { _ -> Signal<Api.Bool, NoError> in
return .complete()
}
|> mapToSignal { _ -> Signal<Void, NoError> in
return .complete()
}
}