mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Update API
This commit is contained in:
parent
055560c065
commit
fba8f6b9f2
@ -383,7 +383,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[195371015] = { return Api.InputPrivacyRule.parse_inputPrivacyValueDisallowContacts($0) }
|
||||
dict[-1877932953] = { return Api.InputPrivacyRule.parse_inputPrivacyValueDisallowUsers($0) }
|
||||
dict[-1672247580] = { return Api.InputReplyTo.parse_inputReplyToMessage($0) }
|
||||
dict[-1139169566] = { return Api.InputReplyTo.parse_inputReplyToStory($0) }
|
||||
dict[363917955] = { return Api.InputReplyTo.parse_inputReplyToStory($0) }
|
||||
dict[1399317950] = { return Api.InputSecureFile.parse_inputSecureFile($0) }
|
||||
dict[859091184] = { return Api.InputSecureFile.parse_inputSecureFileUploaded($0) }
|
||||
dict[-618540889] = { return Api.InputSecureValue.parse_inputSecureValue($0) }
|
||||
@ -910,6 +910,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[834816008] = { return Api.Update.parse_updateStickerSets($0) }
|
||||
dict[196268545] = { return Api.Update.parse_updateStickerSetsOrder($0) }
|
||||
dict[1727715253] = { return Api.Update.parse_updateStories($0) }
|
||||
dict[468923833] = { return Api.Update.parse_updateStoryID($0) }
|
||||
dict[-2112423005] = { return Api.Update.parse_updateTheme($0) }
|
||||
dict[8703322] = { return Api.Update.parse_updateTranscribedAudio($0) }
|
||||
dict[542282808] = { return Api.Update.parse_updateUser($0) }
|
||||
@ -1163,6 +1164,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[1340440049] = { return Api.stories.Stories.parse_stories($0) }
|
||||
dict[-560009955] = { return Api.stories.StoryViews.parse_storyViews($0) }
|
||||
dict[-79726676] = { return Api.stories.StoryViewsList.parse_storyViewsList($0) }
|
||||
dict[933691231] = { return Api.stories.UserStories.parse_userStories($0) }
|
||||
dict[543450958] = { return Api.updates.ChannelDifference.parse_channelDifference($0) }
|
||||
dict[1041346555] = { return Api.updates.ChannelDifference.parse_channelDifferenceEmpty($0) }
|
||||
dict[-1531132162] = { return Api.updates.ChannelDifference.parse_channelDifferenceTooLong($0) }
|
||||
@ -2034,6 +2036,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.stories.StoryViewsList:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.stories.UserStories:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.updates.ChannelDifference:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.updates.Difference:
|
||||
|
@ -1,7 +1,7 @@
|
||||
public extension Api {
|
||||
indirect enum InputReplyTo: TypeConstructorDescription {
|
||||
case inputReplyToMessage(flags: Int32, replyToMsgId: Int32, topMsgId: Int32?)
|
||||
case inputReplyToStory(flags: Int32, userId: Api.InputUser, storyId: Int32)
|
||||
case inputReplyToStory(userId: Api.InputUser, storyId: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
@ -13,11 +13,10 @@ public extension Api {
|
||||
serializeInt32(replyToMsgId, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)}
|
||||
break
|
||||
case .inputReplyToStory(let flags, let userId, let storyId):
|
||||
case .inputReplyToStory(let userId, let storyId):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1139169566)
|
||||
buffer.appendInt32(363917955)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
userId.serialize(buffer, true)
|
||||
serializeInt32(storyId, buffer: buffer, boxed: false)
|
||||
break
|
||||
@ -28,8 +27,8 @@ public extension Api {
|
||||
switch self {
|
||||
case .inputReplyToMessage(let flags, let replyToMsgId, let topMsgId):
|
||||
return ("inputReplyToMessage", [("flags", flags as Any), ("replyToMsgId", replyToMsgId as Any), ("topMsgId", topMsgId as Any)])
|
||||
case .inputReplyToStory(let flags, let userId, let storyId):
|
||||
return ("inputReplyToStory", [("flags", flags as Any), ("userId", userId as Any), ("storyId", storyId as Any)])
|
||||
case .inputReplyToStory(let userId, let storyId):
|
||||
return ("inputReplyToStory", [("userId", userId as Any), ("storyId", storyId as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,19 +50,16 @@ public extension Api {
|
||||
}
|
||||
}
|
||||
public static func parse_inputReplyToStory(_ reader: BufferReader) -> InputReplyTo? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.InputUser?
|
||||
var _1: Api.InputUser?
|
||||
if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.InputUser
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.InputUser
|
||||
}
|
||||
var _3: Int32?
|
||||
_3 = reader.readInt32()
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.InputReplyTo.inputReplyToStory(flags: _1!, userId: _2!, storyId: _3!)
|
||||
if _c1 && _c2 {
|
||||
return Api.InputReplyTo.inputReplyToStory(userId: _1!, storyId: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
@ -1039,6 +1039,7 @@ public extension Api {
|
||||
case updateStickerSets(flags: Int32)
|
||||
case updateStickerSetsOrder(flags: Int32, order: [Int64])
|
||||
case updateStories(stories: Api.UserStories)
|
||||
case updateStoryID(id: Int32, randomId: Int64)
|
||||
case updateTheme(theme: Api.Theme)
|
||||
case updateTranscribedAudio(flags: Int32, peer: Api.Peer, msgId: Int32, transcriptionId: Int64, text: String)
|
||||
case updateUser(userId: Int64)
|
||||
@ -1944,6 +1945,13 @@ public extension Api {
|
||||
}
|
||||
stories.serialize(buffer, true)
|
||||
break
|
||||
case .updateStoryID(let id, let randomId):
|
||||
if boxed {
|
||||
buffer.appendInt32(468923833)
|
||||
}
|
||||
serializeInt32(id, buffer: buffer, boxed: false)
|
||||
serializeInt64(randomId, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .updateTheme(let theme):
|
||||
if boxed {
|
||||
buffer.appendInt32(-2112423005)
|
||||
@ -2232,6 +2240,8 @@ public extension Api {
|
||||
return ("updateStickerSetsOrder", [("flags", flags as Any), ("order", order as Any)])
|
||||
case .updateStories(let stories):
|
||||
return ("updateStories", [("stories", stories as Any)])
|
||||
case .updateStoryID(let id, let randomId):
|
||||
return ("updateStoryID", [("id", id as Any), ("randomId", randomId as Any)])
|
||||
case .updateTheme(let theme):
|
||||
return ("updateTheme", [("theme", theme as Any)])
|
||||
case .updateTranscribedAudio(let flags, let peer, let msgId, let transcriptionId, let text):
|
||||
@ -4032,6 +4042,20 @@ public extension Api {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_updateStoryID(_ reader: BufferReader) -> Update? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Int64?
|
||||
_2 = reader.readInt64()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.Update.updateStoryID(id: _1!, randomId: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_updateTheme(_ reader: BufferReader) -> Update? {
|
||||
var _1: Api.Theme?
|
||||
if let signature = reader.readInt32() {
|
||||
|
@ -606,6 +606,54 @@ public extension Api.stories {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api.stories {
|
||||
enum UserStories: TypeConstructorDescription {
|
||||
case userStories(stories: Api.UserStories, users: [Api.User])
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .userStories(let stories, let users):
|
||||
if boxed {
|
||||
buffer.appendInt32(933691231)
|
||||
}
|
||||
stories.serialize(buffer, true)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(users.count))
|
||||
for item in users {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .userStories(let stories, let users):
|
||||
return ("userStories", [("stories", stories as Any), ("users", users as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_userStories(_ reader: BufferReader) -> UserStories? {
|
||||
var _1: Api.UserStories?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.UserStories
|
||||
}
|
||||
var _2: [Api.User]?
|
||||
if let _ = reader.readInt32() {
|
||||
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.stories.UserStories.userStories(stories: _1!, users: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api.updates {
|
||||
enum ChannelDifference: TypeConstructorDescription {
|
||||
case channelDifference(flags: Int32, pts: Int32, timeout: Int32?, newMessages: [Api.Message], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User])
|
||||
@ -1232,61 +1280,3 @@ public extension Api.upload {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api.users {
|
||||
enum UserFull: TypeConstructorDescription {
|
||||
case userFull(fullUser: Api.UserFull, chats: [Api.Chat], users: [Api.User])
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .userFull(let fullUser, let chats, let users):
|
||||
if boxed {
|
||||
buffer.appendInt32(997004590)
|
||||
}
|
||||
fullUser.serialize(buffer, true)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(chats.count))
|
||||
for item in chats {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(users.count))
|
||||
for item in users {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .userFull(let fullUser, let chats, let users):
|
||||
return ("userFull", [("fullUser", fullUser as Any), ("chats", chats as Any), ("users", users as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_userFull(_ reader: BufferReader) -> UserFull? {
|
||||
var _1: Api.UserFull?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.UserFull
|
||||
}
|
||||
var _2: [Api.Chat]?
|
||||
if let _ = reader.readInt32() {
|
||||
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
||||
}
|
||||
var _3: [Api.User]?
|
||||
if let _ = reader.readInt32() {
|
||||
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.users.UserFull.userFull(fullUser: _1!, chats: _2!, users: _3!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
8929
submodules/TelegramApi/Sources/Api31.swift
Normal file
8929
submodules/TelegramApi/Sources/Api31.swift
Normal file
File diff suppressed because it is too large
Load Diff
@ -129,7 +129,7 @@ private func sendMessageContent(account: Account, peerId: PeerId, attributes: [M
|
||||
} else if let replyToStoryId = replyToStoryId {
|
||||
if let inputUser = transaction.getPeer(replyToStoryId.peerId).flatMap(apiInputUser) {
|
||||
flags |= 1 << 0
|
||||
replyTo = .inputReplyToStory(flags: 0, userId: inputUser, storyId: replyToStoryId.id)
|
||||
replyTo = .inputReplyToStory(userId: inputUser, storyId: replyToStoryId.id)
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ private func sendMessageContent(account: Account, peerId: PeerId, attributes: [M
|
||||
} else if let replyToStoryId = replyToStoryId {
|
||||
if let inputUser = transaction.getPeer(replyToStoryId.peerId).flatMap(apiInputUser) {
|
||||
flags |= 1 << 0
|
||||
replyTo = .inputReplyToStory(flags: 0, userId: inputUser, storyId: replyToStoryId.id)
|
||||
replyTo = .inputReplyToStory(userId: inputUser, storyId: replyToStoryId.id)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -925,7 +925,7 @@ public final class PendingMessageManager {
|
||||
} else if let replyToStoryId = replyToStoryId {
|
||||
if let inputUser = transaction.getPeer(replyToStoryId.peerId).flatMap(apiInputUser) {
|
||||
flags |= 1 << 0
|
||||
replyTo = .inputReplyToStory(flags: 0, userId: inputUser, storyId: replyToStoryId.id)
|
||||
replyTo = .inputReplyToStory(userId: inputUser, storyId: replyToStoryId.id)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1172,7 +1172,7 @@ public final class PendingMessageManager {
|
||||
} else if let replyToStoryId = replyToStoryId {
|
||||
if let inputUser = transaction.getPeer(replyToStoryId.peerId).flatMap(apiInputUser) {
|
||||
flags |= 1 << 0
|
||||
replyTo = .inputReplyToStory(flags: 0, userId: inputUser, storyId: replyToStoryId.id)
|
||||
replyTo = .inputReplyToStory(userId: inputUser, storyId: replyToStoryId.id)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1194,7 +1194,7 @@ public final class PendingMessageManager {
|
||||
} else if let replyToStoryId = replyToStoryId {
|
||||
if let inputUser = transaction.getPeer(replyToStoryId.peerId).flatMap(apiInputUser) {
|
||||
flags |= 1 << 0
|
||||
replyTo = .inputReplyToStory(flags: 0, userId: inputUser, storyId: replyToStoryId.id)
|
||||
replyTo = .inputReplyToStory(userId: inputUser, storyId: replyToStoryId.id)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1230,7 +1230,7 @@ public final class PendingMessageManager {
|
||||
} else if let replyToStoryId = replyToStoryId {
|
||||
if let inputUser = transaction.getPeer(replyToStoryId.peerId).flatMap(apiInputUser) {
|
||||
flags |= 1 << 0
|
||||
replyTo = .inputReplyToStory(flags: 0, userId: inputUser, storyId: replyToStoryId.id)
|
||||
replyTo = .inputReplyToStory(userId: inputUser, storyId: replyToStoryId.id)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1245,7 +1245,7 @@ public final class PendingMessageManager {
|
||||
} else if let replyToStoryId = replyToStoryId {
|
||||
if let inputUser = transaction.getPeer(replyToStoryId.peerId).flatMap(apiInputUser) {
|
||||
flags |= 1 << 0
|
||||
replyTo = .inputReplyToStory(flags: 0, userId: inputUser, storyId: replyToStoryId.id)
|
||||
replyTo = .inputReplyToStory(userId: inputUser, storyId: replyToStoryId.id)
|
||||
} else {
|
||||
let replyFlags: Int32 = 0
|
||||
replyTo = .inputReplyToMessage(flags: replyFlags, replyToMsgId: 0, topMsgId: nil)
|
||||
|
@ -603,7 +603,8 @@ func _internal_uploadStory(account: Account, media: EngineStoryInputMedia, text:
|
||||
media: inputMedia,
|
||||
caption: apiCaption,
|
||||
entities: apiEntities,
|
||||
privacyRules: privacyRules
|
||||
privacyRules: privacyRules,
|
||||
randomId: Int64.random(in: Int64.min ... Int64.max)
|
||||
))
|
||||
|> map(Optional.init)
|
||||
|> `catch` { _ -> Signal<Api.Updates?, NoError> in
|
||||
|
Loading…
x
Reference in New Issue
Block a user