mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Wallpaper improvements
This commit is contained in:
@@ -1,183 +1,3 @@
|
||||
public extension Api {
|
||||
enum PrivacyRule: TypeConstructorDescription {
|
||||
case privacyValueAllowAll
|
||||
case privacyValueAllowChatParticipants(chats: [Int64])
|
||||
case privacyValueAllowCloseFriends
|
||||
case privacyValueAllowContacts
|
||||
case privacyValueAllowUsers(users: [Int64])
|
||||
case privacyValueDisallowAll
|
||||
case privacyValueDisallowChatParticipants(chats: [Int64])
|
||||
case privacyValueDisallowContacts
|
||||
case privacyValueDisallowUsers(users: [Int64])
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .privacyValueAllowAll:
|
||||
if boxed {
|
||||
buffer.appendInt32(1698855810)
|
||||
}
|
||||
|
||||
break
|
||||
case .privacyValueAllowChatParticipants(let chats):
|
||||
if boxed {
|
||||
buffer.appendInt32(1796427406)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(chats.count))
|
||||
for item in chats {
|
||||
serializeInt64(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
case .privacyValueAllowCloseFriends:
|
||||
if boxed {
|
||||
buffer.appendInt32(-135735141)
|
||||
}
|
||||
|
||||
break
|
||||
case .privacyValueAllowContacts:
|
||||
if boxed {
|
||||
buffer.appendInt32(-123988)
|
||||
}
|
||||
|
||||
break
|
||||
case .privacyValueAllowUsers(let users):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1198497870)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(users.count))
|
||||
for item in users {
|
||||
serializeInt64(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
case .privacyValueDisallowAll:
|
||||
if boxed {
|
||||
buffer.appendInt32(-1955338397)
|
||||
}
|
||||
|
||||
break
|
||||
case .privacyValueDisallowChatParticipants(let chats):
|
||||
if boxed {
|
||||
buffer.appendInt32(1103656293)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(chats.count))
|
||||
for item in chats {
|
||||
serializeInt64(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
case .privacyValueDisallowContacts:
|
||||
if boxed {
|
||||
buffer.appendInt32(-125240806)
|
||||
}
|
||||
|
||||
break
|
||||
case .privacyValueDisallowUsers(let users):
|
||||
if boxed {
|
||||
buffer.appendInt32(-463335103)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(users.count))
|
||||
for item in users {
|
||||
serializeInt64(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .privacyValueAllowAll:
|
||||
return ("privacyValueAllowAll", [])
|
||||
case .privacyValueAllowChatParticipants(let chats):
|
||||
return ("privacyValueAllowChatParticipants", [("chats", chats as Any)])
|
||||
case .privacyValueAllowCloseFriends:
|
||||
return ("privacyValueAllowCloseFriends", [])
|
||||
case .privacyValueAllowContacts:
|
||||
return ("privacyValueAllowContacts", [])
|
||||
case .privacyValueAllowUsers(let users):
|
||||
return ("privacyValueAllowUsers", [("users", users as Any)])
|
||||
case .privacyValueDisallowAll:
|
||||
return ("privacyValueDisallowAll", [])
|
||||
case .privacyValueDisallowChatParticipants(let chats):
|
||||
return ("privacyValueDisallowChatParticipants", [("chats", chats as Any)])
|
||||
case .privacyValueDisallowContacts:
|
||||
return ("privacyValueDisallowContacts", [])
|
||||
case .privacyValueDisallowUsers(let users):
|
||||
return ("privacyValueDisallowUsers", [("users", users as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_privacyValueAllowAll(_ reader: BufferReader) -> PrivacyRule? {
|
||||
return Api.PrivacyRule.privacyValueAllowAll
|
||||
}
|
||||
public static func parse_privacyValueAllowChatParticipants(_ reader: BufferReader) -> PrivacyRule? {
|
||||
var _1: [Int64]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.PrivacyRule.privacyValueAllowChatParticipants(chats: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_privacyValueAllowCloseFriends(_ reader: BufferReader) -> PrivacyRule? {
|
||||
return Api.PrivacyRule.privacyValueAllowCloseFriends
|
||||
}
|
||||
public static func parse_privacyValueAllowContacts(_ reader: BufferReader) -> PrivacyRule? {
|
||||
return Api.PrivacyRule.privacyValueAllowContacts
|
||||
}
|
||||
public static func parse_privacyValueAllowUsers(_ reader: BufferReader) -> PrivacyRule? {
|
||||
var _1: [Int64]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.PrivacyRule.privacyValueAllowUsers(users: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_privacyValueDisallowAll(_ reader: BufferReader) -> PrivacyRule? {
|
||||
return Api.PrivacyRule.privacyValueDisallowAll
|
||||
}
|
||||
public static func parse_privacyValueDisallowChatParticipants(_ reader: BufferReader) -> PrivacyRule? {
|
||||
var _1: [Int64]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.PrivacyRule.privacyValueDisallowChatParticipants(chats: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_privacyValueDisallowContacts(_ reader: BufferReader) -> PrivacyRule? {
|
||||
return Api.PrivacyRule.privacyValueDisallowContacts
|
||||
}
|
||||
public static func parse_privacyValueDisallowUsers(_ reader: BufferReader) -> PrivacyRule? {
|
||||
var _1: [Int64]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.PrivacyRule.privacyValueDisallowUsers(users: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum Reaction: TypeConstructorDescription {
|
||||
case reactionCustomEmoji(documentId: Int64)
|
||||
@@ -768,3 +588,563 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum RequestPeerType: TypeConstructorDescription {
|
||||
case requestPeerTypeBroadcast(flags: Int32, hasUsername: Api.Bool?, userAdminRights: Api.ChatAdminRights?, botAdminRights: Api.ChatAdminRights?)
|
||||
case requestPeerTypeChat(flags: Int32, hasUsername: Api.Bool?, forum: Api.Bool?, userAdminRights: Api.ChatAdminRights?, botAdminRights: Api.ChatAdminRights?)
|
||||
case requestPeerTypeUser(flags: Int32, bot: Api.Bool?, premium: Api.Bool?)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .requestPeerTypeBroadcast(let flags, let hasUsername, let userAdminRights, let botAdminRights):
|
||||
if boxed {
|
||||
buffer.appendInt32(865857388)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 3) != 0 {hasUsername!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {userAdminRights!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {botAdminRights!.serialize(buffer, true)}
|
||||
break
|
||||
case .requestPeerTypeChat(let flags, let hasUsername, let forum, let userAdminRights, let botAdminRights):
|
||||
if boxed {
|
||||
buffer.appendInt32(-906990053)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 3) != 0 {hasUsername!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 4) != 0 {forum!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {userAdminRights!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {botAdminRights!.serialize(buffer, true)}
|
||||
break
|
||||
case .requestPeerTypeUser(let flags, let bot, let premium):
|
||||
if boxed {
|
||||
buffer.appendInt32(1597737472)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {bot!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {premium!.serialize(buffer, true)}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .requestPeerTypeBroadcast(let flags, let hasUsername, let userAdminRights, let botAdminRights):
|
||||
return ("requestPeerTypeBroadcast", [("flags", flags as Any), ("hasUsername", hasUsername as Any), ("userAdminRights", userAdminRights as Any), ("botAdminRights", botAdminRights as Any)])
|
||||
case .requestPeerTypeChat(let flags, let hasUsername, let forum, let userAdminRights, let botAdminRights):
|
||||
return ("requestPeerTypeChat", [("flags", flags as Any), ("hasUsername", hasUsername as Any), ("forum", forum as Any), ("userAdminRights", userAdminRights as Any), ("botAdminRights", botAdminRights as Any)])
|
||||
case .requestPeerTypeUser(let flags, let bot, let premium):
|
||||
return ("requestPeerTypeUser", [("flags", flags as Any), ("bot", bot as Any), ("premium", premium as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_requestPeerTypeBroadcast(_ reader: BufferReader) -> RequestPeerType? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.Bool?
|
||||
if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
} }
|
||||
var _3: Api.ChatAdminRights?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
|
||||
_3 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights
|
||||
} }
|
||||
var _4: Api.ChatAdminRights?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.RequestPeerType.requestPeerTypeBroadcast(flags: _1!, hasUsername: _2, userAdminRights: _3, botAdminRights: _4)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_requestPeerTypeChat(_ reader: BufferReader) -> RequestPeerType? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.Bool?
|
||||
if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
} }
|
||||
var _3: Api.Bool?
|
||||
if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() {
|
||||
_3 = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
} }
|
||||
var _4: Api.ChatAdminRights?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights
|
||||
} }
|
||||
var _5: Api.ChatAdminRights?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() {
|
||||
_5 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 4) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
|
||||
let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.RequestPeerType.requestPeerTypeChat(flags: _1!, hasUsername: _2, forum: _3, userAdminRights: _4, botAdminRights: _5)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_requestPeerTypeUser(_ reader: BufferReader) -> RequestPeerType? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.Bool?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
} }
|
||||
var _3: Api.Bool?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
|
||||
_3 = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.RequestPeerType.requestPeerTypeUser(flags: _1!, bot: _2, premium: _3)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum RestrictionReason: TypeConstructorDescription {
|
||||
case restrictionReason(platform: String, reason: String, text: String)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .restrictionReason(let platform, let reason, let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(-797791052)
|
||||
}
|
||||
serializeString(platform, buffer: buffer, boxed: false)
|
||||
serializeString(reason, buffer: buffer, boxed: false)
|
||||
serializeString(text, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .restrictionReason(let platform, let reason, let text):
|
||||
return ("restrictionReason", [("platform", platform as Any), ("reason", reason as Any), ("text", text as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_restrictionReason(_ reader: BufferReader) -> RestrictionReason? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
var _3: String?
|
||||
_3 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.RestrictionReason.restrictionReason(platform: _1!, reason: _2!, text: _3!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
indirect enum RichText: TypeConstructorDescription {
|
||||
case textAnchor(text: Api.RichText, name: String)
|
||||
case textBold(text: Api.RichText)
|
||||
case textConcat(texts: [Api.RichText])
|
||||
case textEmail(text: Api.RichText, email: String)
|
||||
case textEmpty
|
||||
case textFixed(text: Api.RichText)
|
||||
case textImage(documentId: Int64, w: Int32, h: Int32)
|
||||
case textItalic(text: Api.RichText)
|
||||
case textMarked(text: Api.RichText)
|
||||
case textPhone(text: Api.RichText, phone: String)
|
||||
case textPlain(text: String)
|
||||
case textStrike(text: Api.RichText)
|
||||
case textSubscript(text: Api.RichText)
|
||||
case textSuperscript(text: Api.RichText)
|
||||
case textUnderline(text: Api.RichText)
|
||||
case textUrl(text: Api.RichText, url: String, webpageId: Int64)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .textAnchor(let text, let name):
|
||||
if boxed {
|
||||
buffer.appendInt32(894777186)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
serializeString(name, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .textBold(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(1730456516)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
break
|
||||
case .textConcat(let texts):
|
||||
if boxed {
|
||||
buffer.appendInt32(2120376535)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(texts.count))
|
||||
for item in texts {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
case .textEmail(let text, let email):
|
||||
if boxed {
|
||||
buffer.appendInt32(-564523562)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
serializeString(email, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .textEmpty:
|
||||
if boxed {
|
||||
buffer.appendInt32(-599948721)
|
||||
}
|
||||
|
||||
break
|
||||
case .textFixed(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(1816074681)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
break
|
||||
case .textImage(let documentId, let w, let h):
|
||||
if boxed {
|
||||
buffer.appendInt32(136105807)
|
||||
}
|
||||
serializeInt64(documentId, buffer: buffer, boxed: false)
|
||||
serializeInt32(w, buffer: buffer, boxed: false)
|
||||
serializeInt32(h, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .textItalic(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(-653089380)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
break
|
||||
case .textMarked(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(55281185)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
break
|
||||
case .textPhone(let text, let phone):
|
||||
if boxed {
|
||||
buffer.appendInt32(483104362)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
serializeString(phone, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .textPlain(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(1950782688)
|
||||
}
|
||||
serializeString(text, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .textStrike(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1678197867)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
break
|
||||
case .textSubscript(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(-311786236)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
break
|
||||
case .textSuperscript(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(-939827711)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
break
|
||||
case .textUnderline(let text):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1054465340)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
break
|
||||
case .textUrl(let text, let url, let webpageId):
|
||||
if boxed {
|
||||
buffer.appendInt32(1009288385)
|
||||
}
|
||||
text.serialize(buffer, true)
|
||||
serializeString(url, buffer: buffer, boxed: false)
|
||||
serializeInt64(webpageId, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .textAnchor(let text, let name):
|
||||
return ("textAnchor", [("text", text as Any), ("name", name as Any)])
|
||||
case .textBold(let text):
|
||||
return ("textBold", [("text", text as Any)])
|
||||
case .textConcat(let texts):
|
||||
return ("textConcat", [("texts", texts as Any)])
|
||||
case .textEmail(let text, let email):
|
||||
return ("textEmail", [("text", text as Any), ("email", email as Any)])
|
||||
case .textEmpty:
|
||||
return ("textEmpty", [])
|
||||
case .textFixed(let text):
|
||||
return ("textFixed", [("text", text as Any)])
|
||||
case .textImage(let documentId, let w, let h):
|
||||
return ("textImage", [("documentId", documentId as Any), ("w", w as Any), ("h", h as Any)])
|
||||
case .textItalic(let text):
|
||||
return ("textItalic", [("text", text as Any)])
|
||||
case .textMarked(let text):
|
||||
return ("textMarked", [("text", text as Any)])
|
||||
case .textPhone(let text, let phone):
|
||||
return ("textPhone", [("text", text as Any), ("phone", phone as Any)])
|
||||
case .textPlain(let text):
|
||||
return ("textPlain", [("text", text as Any)])
|
||||
case .textStrike(let text):
|
||||
return ("textStrike", [("text", text as Any)])
|
||||
case .textSubscript(let text):
|
||||
return ("textSubscript", [("text", text as Any)])
|
||||
case .textSuperscript(let text):
|
||||
return ("textSuperscript", [("text", text as Any)])
|
||||
case .textUnderline(let text):
|
||||
return ("textUnderline", [("text", text as Any)])
|
||||
case .textUrl(let text, let url, let webpageId):
|
||||
return ("textUrl", [("text", text as Any), ("url", url as Any), ("webpageId", webpageId as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_textAnchor(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.RichText.textAnchor(text: _1!, name: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textBold(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textBold(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textConcat(_ reader: BufferReader) -> RichText? {
|
||||
var _1: [Api.RichText]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RichText.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textConcat(texts: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textEmail(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.RichText.textEmail(text: _1!, email: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textEmpty(_ reader: BufferReader) -> RichText? {
|
||||
return Api.RichText.textEmpty
|
||||
}
|
||||
public static func parse_textFixed(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textFixed(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textImage(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Int64?
|
||||
_1 = reader.readInt64()
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
var _3: Int32?
|
||||
_3 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.RichText.textImage(documentId: _1!, w: _2!, h: _3!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textItalic(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textItalic(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textMarked(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textMarked(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textPhone(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.RichText.textPhone(text: _1!, phone: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textPlain(_ reader: BufferReader) -> RichText? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textPlain(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textStrike(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textStrike(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textSubscript(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textSubscript(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textSuperscript(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textSuperscript(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textUnderline(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.RichText.textUnderline(text: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_textUrl(_ reader: BufferReader) -> RichText? {
|
||||
var _1: Api.RichText?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
||||
}
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
var _3: Int64?
|
||||
_3 = reader.readInt64()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.RichText.textUrl(text: _1!, url: _2!, webpageId: _3!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user