mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 13:13:55 +00:00
Update API
This commit is contained in:
parent
1272e80e29
commit
957490fefc
@ -451,6 +451,9 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[695856818] = { return Api.LangPackString.parse_langPackStringDeleted($0) }
|
||||
dict[1816636575] = { return Api.LangPackString.parse_langPackStringPluralized($0) }
|
||||
dict[-1361650766] = { return Api.MaskCoords.parse_maskCoords($0) }
|
||||
dict[-1300094593] = { return Api.MediaArea.parse_inputMediaAreaVenue($0) }
|
||||
dict[-1098720356] = { return Api.MediaArea.parse_mediaAreaVenue($0) }
|
||||
dict[64088654] = { return Api.MediaAreaCoordinates.parse_mediaAreaCoordinates($0) }
|
||||
dict[940666592] = { return Api.Message.parse_message($0) }
|
||||
dict[-1868117372] = { return Api.Message.parse_messageEmpty($0) }
|
||||
dict[721967202] = { return Api.Message.parse_messageService($0) }
|
||||
@ -794,10 +797,10 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[872932635] = { return Api.StickerSetCovered.parse_stickerSetMultiCovered($0) }
|
||||
dict[2008112412] = { return Api.StickerSetCovered.parse_stickerSetNoCovered($0) }
|
||||
dict[1898850301] = { return Api.StoriesStealthMode.parse_storiesStealthMode($0) }
|
||||
dict[1445635639] = { return Api.StoryItem.parse_storyItem($0) }
|
||||
dict[-1806085190] = { return Api.StoryItem.parse_storyItem($0) }
|
||||
dict[1374088783] = { return Api.StoryItem.parse_storyItemDeleted($0) }
|
||||
dict[-5388013] = { return Api.StoryItem.parse_storyItemSkipped($0) }
|
||||
dict[-1491424062] = { return Api.StoryView.parse_storyView($0) }
|
||||
dict[-793729058] = { return Api.StoryView.parse_storyView($0) }
|
||||
dict[-748199729] = { return Api.StoryViews.parse_storyViews($0) }
|
||||
dict[1964978502] = { return Api.TextWithEntities.parse_textWithEntities($0) }
|
||||
dict[-1609668650] = { return Api.Theme.parse_theme($0) }
|
||||
@ -884,7 +887,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[967122427] = { return Api.Update.parse_updateNewScheduledMessage($0) }
|
||||
dict[1753886890] = { return Api.Update.parse_updateNewStickerSet($0) }
|
||||
dict[-1094555409] = { return Api.Update.parse_updateNotifySettings($0) }
|
||||
dict[610945826] = { return Api.Update.parse_updatePeerBlocked($0) }
|
||||
dict[-337610926] = { return Api.Update.parse_updatePeerBlocked($0) }
|
||||
dict[-1147422299] = { return Api.Update.parse_updatePeerHistoryTTL($0) }
|
||||
dict[-1263546448] = { return Api.Update.parse_updatePeerLocated($0) }
|
||||
dict[1786671974] = { return Api.Update.parse_updatePeerSettings($0) }
|
||||
@ -914,7 +917,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-337352679] = { return Api.Update.parse_updateServiceNotification($0) }
|
||||
dict[834816008] = { return Api.Update.parse_updateStickerSets($0) }
|
||||
dict[196268545] = { return Api.Update.parse_updateStickerSetsOrder($0) }
|
||||
dict[-719158423] = { return Api.Update.parse_updateStoriesStealth($0) }
|
||||
dict[738741697] = { return Api.Update.parse_updateStoriesStealthMode($0) }
|
||||
dict[542785843] = { return Api.Update.parse_updateStory($0) }
|
||||
dict[468923833] = { return Api.Update.parse_updateStoryID($0) }
|
||||
@ -1542,6 +1544,10 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MaskCoords:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MediaArea:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MediaAreaCoordinates:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.Message:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MessageAction:
|
||||
|
||||
@ -46,6 +46,152 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum MediaArea: TypeConstructorDescription {
|
||||
case inputMediaAreaVenue(coordinates: Api.MediaAreaCoordinates, queryId: Int64, resultId: String)
|
||||
case mediaAreaVenue(coordinates: Api.MediaAreaCoordinates, geo: Api.GeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .inputMediaAreaVenue(let coordinates, let queryId, let resultId):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1300094593)
|
||||
}
|
||||
coordinates.serialize(buffer, true)
|
||||
serializeInt64(queryId, buffer: buffer, boxed: false)
|
||||
serializeString(resultId, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .mediaAreaVenue(let coordinates, let geo, let title, let address, let provider, let venueId, let venueType):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1098720356)
|
||||
}
|
||||
coordinates.serialize(buffer, true)
|
||||
geo.serialize(buffer, true)
|
||||
serializeString(title, buffer: buffer, boxed: false)
|
||||
serializeString(address, buffer: buffer, boxed: false)
|
||||
serializeString(provider, buffer: buffer, boxed: false)
|
||||
serializeString(venueId, buffer: buffer, boxed: false)
|
||||
serializeString(venueType, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .inputMediaAreaVenue(let coordinates, let queryId, let resultId):
|
||||
return ("inputMediaAreaVenue", [("coordinates", coordinates as Any), ("queryId", queryId as Any), ("resultId", resultId as Any)])
|
||||
case .mediaAreaVenue(let coordinates, let geo, let title, let address, let provider, let venueId, let venueType):
|
||||
return ("mediaAreaVenue", [("coordinates", coordinates as Any), ("geo", geo as Any), ("title", title as Any), ("address", address as Any), ("provider", provider as Any), ("venueId", venueId as Any), ("venueType", venueType as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_inputMediaAreaVenue(_ reader: BufferReader) -> MediaArea? {
|
||||
var _1: Api.MediaAreaCoordinates?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.MediaAreaCoordinates
|
||||
}
|
||||
var _2: Int64?
|
||||
_2 = reader.readInt64()
|
||||
var _3: String?
|
||||
_3 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.MediaArea.inputMediaAreaVenue(coordinates: _1!, queryId: _2!, resultId: _3!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_mediaAreaVenue(_ reader: BufferReader) -> MediaArea? {
|
||||
var _1: Api.MediaAreaCoordinates?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.MediaAreaCoordinates
|
||||
}
|
||||
var _2: Api.GeoPoint?
|
||||
if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.GeoPoint
|
||||
}
|
||||
var _3: String?
|
||||
_3 = parseString(reader)
|
||||
var _4: String?
|
||||
_4 = parseString(reader)
|
||||
var _5: String?
|
||||
_5 = parseString(reader)
|
||||
var _6: String?
|
||||
_6 = parseString(reader)
|
||||
var _7: String?
|
||||
_7 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = _5 != nil
|
||||
let _c6 = _6 != nil
|
||||
let _c7 = _7 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
||||
return Api.MediaArea.mediaAreaVenue(coordinates: _1!, geo: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum MediaAreaCoordinates: TypeConstructorDescription {
|
||||
case mediaAreaCoordinates(x: Double, y: Double, w: Double, h: Double, rotation: Double)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .mediaAreaCoordinates(let x, let y, let w, let h, let rotation):
|
||||
if boxed {
|
||||
buffer.appendInt32(64088654)
|
||||
}
|
||||
serializeDouble(x, buffer: buffer, boxed: false)
|
||||
serializeDouble(y, buffer: buffer, boxed: false)
|
||||
serializeDouble(w, buffer: buffer, boxed: false)
|
||||
serializeDouble(h, buffer: buffer, boxed: false)
|
||||
serializeDouble(rotation, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .mediaAreaCoordinates(let x, let y, let w, let h, let rotation):
|
||||
return ("mediaAreaCoordinates", [("x", x as Any), ("y", y as Any), ("w", w as Any), ("h", h as Any), ("rotation", rotation as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_mediaAreaCoordinates(_ reader: BufferReader) -> MediaAreaCoordinates? {
|
||||
var _1: Double?
|
||||
_1 = reader.readDouble()
|
||||
var _2: Double?
|
||||
_2 = reader.readDouble()
|
||||
var _3: Double?
|
||||
_3 = reader.readDouble()
|
||||
var _4: Double?
|
||||
_4 = reader.readDouble()
|
||||
var _5: Double?
|
||||
_5 = reader.readDouble()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = _5 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.MediaAreaCoordinates.mediaAreaCoordinates(x: _1!, y: _2!, w: _3!, h: _4!, rotation: _5!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
indirect enum Message: TypeConstructorDescription {
|
||||
case message(flags: Int32, id: Int32, fromId: Api.Peer?, peerId: Api.Peer, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, replyTo: Api.MessageReplyHeader?, date: Int32, message: String, media: Api.MessageMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, views: Int32?, forwards: Int32?, replies: Api.MessageReplies?, editDate: Int32?, postAuthor: String?, groupedId: Int64?, reactions: Api.MessageReactions?, restrictionReason: [Api.RestrictionReason]?, ttlPeriod: Int32?)
|
||||
|
||||
@ -408,15 +408,15 @@ public extension Api {
|
||||
}
|
||||
public extension Api {
|
||||
indirect enum StoryItem: TypeConstructorDescription {
|
||||
case storyItem(flags: Int32, id: Int32, date: Int32, expireDate: Int32, caption: String?, entities: [Api.MessageEntity]?, media: Api.MessageMedia, privacy: [Api.PrivacyRule]?, views: Api.StoryViews?)
|
||||
case storyItem(flags: Int32, id: Int32, date: Int32, expireDate: Int32, caption: String?, entities: [Api.MessageEntity]?, media: Api.MessageMedia, mediaAreas: [Api.MediaArea]?, privacy: [Api.PrivacyRule]?, views: Api.StoryViews?)
|
||||
case storyItemDeleted(id: Int32)
|
||||
case storyItemSkipped(flags: Int32, id: Int32, date: Int32, expireDate: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .storyItem(let flags, let id, let date, let expireDate, let caption, let entities, let media, let privacy, let views):
|
||||
case .storyItem(let flags, let id, let date, let expireDate, let caption, let entities, let media, let mediaAreas, let privacy, let views):
|
||||
if boxed {
|
||||
buffer.appendInt32(1445635639)
|
||||
buffer.appendInt32(-1806085190)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt32(id, buffer: buffer, boxed: false)
|
||||
@ -429,6 +429,11 @@ public extension Api {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
media.serialize(buffer, true)
|
||||
if Int(flags) & Int(1 << 14) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(mediaAreas!.count))
|
||||
for item in mediaAreas! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(privacy!.count))
|
||||
for item in privacy! {
|
||||
@ -456,8 +461,8 @@ public extension Api {
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .storyItem(let flags, let id, let date, let expireDate, let caption, let entities, let media, let privacy, let views):
|
||||
return ("storyItem", [("flags", flags as Any), ("id", id as Any), ("date", date as Any), ("expireDate", expireDate as Any), ("caption", caption as Any), ("entities", entities as Any), ("media", media as Any), ("privacy", privacy as Any), ("views", views as Any)])
|
||||
case .storyItem(let flags, let id, let date, let expireDate, let caption, let entities, let media, let mediaAreas, let privacy, let views):
|
||||
return ("storyItem", [("flags", flags as Any), ("id", id as Any), ("date", date as Any), ("expireDate", expireDate as Any), ("caption", caption as Any), ("entities", entities as Any), ("media", media as Any), ("mediaAreas", mediaAreas as Any), ("privacy", privacy as Any), ("views", views as Any)])
|
||||
case .storyItemDeleted(let id):
|
||||
return ("storyItemDeleted", [("id", id as Any)])
|
||||
case .storyItemSkipped(let flags, let id, let date, let expireDate):
|
||||
@ -484,13 +489,17 @@ public extension Api {
|
||||
if let signature = reader.readInt32() {
|
||||
_7 = Api.parse(reader, signature: signature) as? Api.MessageMedia
|
||||
}
|
||||
var _8: [Api.PrivacyRule]?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() {
|
||||
_8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrivacyRule.self)
|
||||
var _8: [Api.MediaArea]?
|
||||
if Int(_1!) & Int(1 << 14) != 0 {if let _ = reader.readInt32() {
|
||||
_8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MediaArea.self)
|
||||
} }
|
||||
var _9: Api.StoryViews?
|
||||
var _9: [Api.PrivacyRule]?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() {
|
||||
_9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrivacyRule.self)
|
||||
} }
|
||||
var _10: Api.StoryViews?
|
||||
if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() {
|
||||
_9 = Api.parse(reader, signature: signature) as? Api.StoryViews
|
||||
_10 = Api.parse(reader, signature: signature) as? Api.StoryViews
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
@ -499,10 +508,11 @@ public extension Api {
|
||||
let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil
|
||||
let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil
|
||||
let _c7 = _7 != nil
|
||||
let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil
|
||||
let _c9 = (Int(_1!) & Int(1 << 3) == 0) || _9 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 {
|
||||
return Api.StoryItem.storyItem(flags: _1!, id: _2!, date: _3!, expireDate: _4!, caption: _5, entities: _6, media: _7!, privacy: _8, views: _9)
|
||||
let _c8 = (Int(_1!) & Int(1 << 14) == 0) || _8 != nil
|
||||
let _c9 = (Int(_1!) & Int(1 << 2) == 0) || _9 != nil
|
||||
let _c10 = (Int(_1!) & Int(1 << 3) == 0) || _10 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 {
|
||||
return Api.StoryItem.storyItem(flags: _1!, id: _2!, date: _3!, expireDate: _4!, caption: _5, entities: _6, media: _7!, mediaAreas: _8, privacy: _9, views: _10)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
@ -544,14 +554,15 @@ public extension Api {
|
||||
}
|
||||
public extension Api {
|
||||
enum StoryView: TypeConstructorDescription {
|
||||
case storyView(userId: Int64, date: Int32)
|
||||
case storyView(flags: Int32, userId: Int64, date: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .storyView(let userId, let date):
|
||||
case .storyView(let flags, let userId, let date):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1491424062)
|
||||
buffer.appendInt32(-793729058)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt64(userId, buffer: buffer, boxed: false)
|
||||
serializeInt32(date, buffer: buffer, boxed: false)
|
||||
break
|
||||
@ -560,20 +571,23 @@ public extension Api {
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .storyView(let userId, let date):
|
||||
return ("storyView", [("userId", userId as Any), ("date", date as Any)])
|
||||
case .storyView(let flags, let userId, let date):
|
||||
return ("storyView", [("flags", flags as Any), ("userId", userId as Any), ("date", date as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_storyView(_ reader: BufferReader) -> StoryView? {
|
||||
var _1: Int64?
|
||||
_1 = reader.readInt64()
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Int64?
|
||||
_2 = reader.readInt64()
|
||||
var _3: Int32?
|
||||
_3 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.StoryView.storyView(userId: _1!, date: _2!)
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.StoryView.storyView(flags: _1!, userId: _2!, date: _3!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
@ -1100,7 +1114,7 @@ public extension Api {
|
||||
case updateNewScheduledMessage(message: Api.Message)
|
||||
case updateNewStickerSet(stickerset: Api.messages.StickerSet)
|
||||
case updateNotifySettings(peer: Api.NotifyPeer, notifySettings: Api.PeerNotifySettings)
|
||||
case updatePeerBlocked(peerId: Api.Peer, blocked: Api.Bool)
|
||||
case updatePeerBlocked(flags: Int32, peerId: Api.Peer)
|
||||
case updatePeerHistoryTTL(flags: Int32, peer: Api.Peer, ttlPeriod: Int32?)
|
||||
case updatePeerLocated(peers: [Api.PeerLocated])
|
||||
case updatePeerSettings(peer: Api.Peer, settings: Api.PeerSettings)
|
||||
@ -1130,7 +1144,6 @@ public extension Api {
|
||||
case updateServiceNotification(flags: Int32, inboxDate: Int32?, type: String, message: String, media: Api.MessageMedia, entities: [Api.MessageEntity])
|
||||
case updateStickerSets(flags: Int32)
|
||||
case updateStickerSetsOrder(flags: Int32, order: [Int64])
|
||||
case updateStoriesStealth(expireDate: Int32)
|
||||
case updateStoriesStealthMode(stealthMode: Api.StoriesStealthMode)
|
||||
case updateStory(userId: Int64, story: Api.StoryItem)
|
||||
case updateStoryID(id: Int32, randomId: Int64)
|
||||
@ -1768,12 +1781,12 @@ public extension Api {
|
||||
peer.serialize(buffer, true)
|
||||
notifySettings.serialize(buffer, true)
|
||||
break
|
||||
case .updatePeerBlocked(let peerId, let blocked):
|
||||
case .updatePeerBlocked(let flags, let peerId):
|
||||
if boxed {
|
||||
buffer.appendInt32(610945826)
|
||||
buffer.appendInt32(-337610926)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
peerId.serialize(buffer, true)
|
||||
blocked.serialize(buffer, true)
|
||||
break
|
||||
case .updatePeerHistoryTTL(let flags, let peer, let ttlPeriod):
|
||||
if boxed {
|
||||
@ -2033,12 +2046,6 @@ public extension Api {
|
||||
serializeInt64(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
case .updateStoriesStealth(let expireDate):
|
||||
if boxed {
|
||||
buffer.appendInt32(-719158423)
|
||||
}
|
||||
serializeInt32(expireDate, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .updateStoriesStealthMode(let stealthMode):
|
||||
if boxed {
|
||||
buffer.appendInt32(738741697)
|
||||
@ -2285,8 +2292,8 @@ public extension Api {
|
||||
return ("updateNewStickerSet", [("stickerset", stickerset as Any)])
|
||||
case .updateNotifySettings(let peer, let notifySettings):
|
||||
return ("updateNotifySettings", [("peer", peer as Any), ("notifySettings", notifySettings as Any)])
|
||||
case .updatePeerBlocked(let peerId, let blocked):
|
||||
return ("updatePeerBlocked", [("peerId", peerId as Any), ("blocked", blocked as Any)])
|
||||
case .updatePeerBlocked(let flags, let peerId):
|
||||
return ("updatePeerBlocked", [("flags", flags as Any), ("peerId", peerId as Any)])
|
||||
case .updatePeerHistoryTTL(let flags, let peer, let ttlPeriod):
|
||||
return ("updatePeerHistoryTTL", [("flags", flags as Any), ("peer", peer as Any), ("ttlPeriod", ttlPeriod as Any)])
|
||||
case .updatePeerLocated(let peers):
|
||||
@ -2345,8 +2352,6 @@ public extension Api {
|
||||
return ("updateStickerSets", [("flags", flags as Any)])
|
||||
case .updateStickerSetsOrder(let flags, let order):
|
||||
return ("updateStickerSetsOrder", [("flags", flags as Any), ("order", order as Any)])
|
||||
case .updateStoriesStealth(let expireDate):
|
||||
return ("updateStoriesStealth", [("expireDate", expireDate as Any)])
|
||||
case .updateStoriesStealthMode(let stealthMode):
|
||||
return ("updateStoriesStealthMode", [("stealthMode", stealthMode as Any)])
|
||||
case .updateStory(let userId, let story):
|
||||
@ -3686,18 +3691,16 @@ public extension Api {
|
||||
}
|
||||
}
|
||||
public static func parse_updatePeerBlocked(_ reader: BufferReader) -> Update? {
|
||||
var _1: Api.Peer?
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.Peer?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.Peer
|
||||
}
|
||||
var _2: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.Peer
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.Update.updatePeerBlocked(peerId: _1!, blocked: _2!)
|
||||
return Api.Update.updatePeerBlocked(flags: _1!, peerId: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
@ -4140,17 +4143,6 @@ public extension Api {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_updateStoriesStealth(_ reader: BufferReader) -> Update? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.Update.updateStoriesStealth(expireDate: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_updateStoriesStealthMode(_ reader: BufferReader) -> Update? {
|
||||
var _1: Api.StoriesStealthMode?
|
||||
if let signature = reader.readInt32() {
|
||||
|
||||
@ -3218,11 +3218,12 @@ public extension Api.functions.contacts {
|
||||
}
|
||||
}
|
||||
public extension Api.functions.contacts {
|
||||
static func block(id: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
static func block(flags: Int32, id: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(1758204945)
|
||||
buffer.appendInt32(774801204)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
id.serialize(buffer, true)
|
||||
return (FunctionDescription(name: "contacts.block", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in
|
||||
return (FunctionDescription(name: "contacts.block", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
@ -3321,12 +3322,13 @@ public extension Api.functions.contacts {
|
||||
}
|
||||
}
|
||||
public extension Api.functions.contacts {
|
||||
static func getBlocked(offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.contacts.Blocked>) {
|
||||
static func getBlocked(flags: Int32, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.contacts.Blocked>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-176409329)
|
||||
buffer.appendInt32(-1702457472)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt32(offset, buffer: buffer, boxed: false)
|
||||
serializeInt32(limit, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription(name: "contacts.getBlocked", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Blocked? in
|
||||
return (FunctionDescription(name: "contacts.getBlocked", parameters: [("flags", String(describing: flags)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Blocked? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.contacts.Blocked?
|
||||
if let signature = reader.readInt32() {
|
||||
@ -3542,6 +3544,27 @@ public extension Api.functions.contacts {
|
||||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.contacts {
|
||||
static func setBlocked(flags: Int32, id: [Api.InputPeer], limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1798939530)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(id.count))
|
||||
for item in id {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
serializeInt32(limit, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription(name: "contacts.setBlocked", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("limit", String(describing: limit))]), 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
|
||||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.contacts {
|
||||
static func toggleStoriesHidden(id: Api.InputUser, hidden: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
let buffer = Buffer()
|
||||
@ -3574,11 +3597,12 @@ public extension Api.functions.contacts {
|
||||
}
|
||||
}
|
||||
public extension Api.functions.contacts {
|
||||
static func unblock(id: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
static func unblock(flags: Int32, id: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1096393392)
|
||||
buffer.appendInt32(-1252994264)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
id.serialize(buffer, true)
|
||||
return (FunctionDescription(name: "contacts.unblock", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in
|
||||
return (FunctionDescription(name: "contacts.unblock", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
@ -8482,12 +8506,17 @@ public extension Api.functions.stories {
|
||||
}
|
||||
}
|
||||
public extension Api.functions.stories {
|
||||
static func editStory(flags: Int32, id: Int32, media: Api.InputMedia?, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
static func editStory(flags: Int32, id: Int32, media: Api.InputMedia?, mediaAreas: [Api.MediaArea]?, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(716077633)
|
||||
buffer.appendInt32(-1447486748)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt32(id, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {media!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(mediaAreas!.count))
|
||||
for item in mediaAreas! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(caption!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(entities!.count))
|
||||
@ -8499,7 +8528,7 @@ public extension Api.functions.stories {
|
||||
for item in privacyRules! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
return (FunctionDescription(name: "stories.editStory", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("media", String(describing: media)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
return (FunctionDescription(name: "stories.editStory", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("media", String(describing: media)), ("mediaAreas", String(describing: mediaAreas)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Updates?
|
||||
if let signature = reader.readInt32() {
|
||||
@ -8720,11 +8749,16 @@ public extension Api.functions.stories {
|
||||
}
|
||||
}
|
||||
public extension Api.functions.stories {
|
||||
static func sendStory(flags: Int32, media: Api.InputMedia, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule], randomId: Int64, period: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
static func sendStory(flags: Int32, media: Api.InputMedia, mediaAreas: [Api.MediaArea]?, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule], randomId: Int64, period: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(1112331386)
|
||||
buffer.appendInt32(-732562196)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
media.serialize(buffer, true)
|
||||
if Int(flags) & Int(1 << 5) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(mediaAreas!.count))
|
||||
for item in mediaAreas! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeString(caption!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(entities!.count))
|
||||
@ -8738,7 +8772,7 @@ public extension Api.functions.stories {
|
||||
}
|
||||
serializeInt64(randomId, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 3) != 0 {serializeInt32(period!, buffer: buffer, boxed: false)}
|
||||
return (FunctionDescription(name: "stories.sendStory", parameters: [("flags", String(describing: flags)), ("media", String(describing: media)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules)), ("randomId", String(describing: randomId)), ("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
return (FunctionDescription(name: "stories.sendStory", parameters: [("flags", String(describing: flags)), ("media", String(describing: media)), ("mediaAreas", String(describing: mediaAreas)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules)), ("randomId", String(describing: randomId)), ("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Updates?
|
||||
if let signature = reader.readInt32() {
|
||||
|
||||
@ -1326,7 +1326,8 @@ private func finalStateWithUpdatesAndServerTime(accountPeerId: PeerId, postbox:
|
||||
channelsToPoll[peerId] = nil
|
||||
}
|
||||
}
|
||||
case let .updatePeerBlocked(peerId, blocked):
|
||||
case let .updatePeerBlocked(flags, peerId):
|
||||
let blocked = (flags & (1 << 0)) != 0
|
||||
let userPeerId = peerId.peerId
|
||||
updatedState.updateCachedPeerData(userPeerId, { current in
|
||||
let previous: CachedUserData
|
||||
@ -1335,7 +1336,7 @@ private func finalStateWithUpdatesAndServerTime(accountPeerId: PeerId, postbox:
|
||||
} else {
|
||||
previous = CachedUserData()
|
||||
}
|
||||
return previous.withUpdatedIsBlocked(blocked == .boolTrue)
|
||||
return previous.withUpdatedIsBlocked(blocked)
|
||||
})
|
||||
case let .updateUserStatus(userId, status):
|
||||
updatedState.mergePeerPresences([PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId)): status], explicit: true)
|
||||
@ -1673,8 +1674,6 @@ private func finalStateWithUpdatesAndServerTime(accountPeerId: PeerId, postbox:
|
||||
updatedState.readStories(peerId: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId)), maxId: id)
|
||||
case let .updateStoriesStealthMode(stealthMode):
|
||||
updatedState.updateStoryStealthMode(stealthMode)
|
||||
case let .updateStoriesStealth(expireDate):
|
||||
updatedState.updateStoryStealth(expireDate: expireDate)
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
@ -894,6 +894,7 @@ func _internal_uploadStoryImpl(postbox: Postbox, network: Network, accountPeerId
|
||||
return network.request(Api.functions.stories.sendStory(
|
||||
flags: flags,
|
||||
media: inputMedia,
|
||||
mediaAreas: nil,
|
||||
caption: apiCaption,
|
||||
entities: apiEntities,
|
||||
privacyRules: privacyRules,
|
||||
@ -922,7 +923,7 @@ func _internal_uploadStoryImpl(postbox: Postbox, network: Network, accountPeerId
|
||||
for update in updates.allUpdates {
|
||||
if case let .updateStory(_, story) = update {
|
||||
switch story {
|
||||
case let .storyItem(_, idValue, _, _, _, _, media, _, _):
|
||||
case let .storyItem(_, idValue, _, _, _, _, media, _, _, _):
|
||||
if let parsedStory = Stories.StoredItem(apiStoryItem: story, peerId: accountPeerId, transaction: transaction) {
|
||||
var items = transaction.getStoryItems(peerId: accountPeerId)
|
||||
var updatedItems: [Stories.Item] = []
|
||||
@ -1046,6 +1047,7 @@ func _internal_editStory(account: Account, id: Int32, media: EngineStoryInputMed
|
||||
flags: flags,
|
||||
id: id,
|
||||
media: inputMedia,
|
||||
mediaAreas: nil,
|
||||
caption: apiCaption,
|
||||
entities: apiEntities,
|
||||
privacyRules: privacyRules
|
||||
@ -1059,7 +1061,7 @@ func _internal_editStory(account: Account, id: Int32, media: EngineStoryInputMed
|
||||
for update in updates.allUpdates {
|
||||
if case let .updateStory(_, story) = update {
|
||||
switch story {
|
||||
case let .storyItem(_, _, _, _, _, _, media, _, _):
|
||||
case let .storyItem(_, _, _, _, _, _, media, _, _, _):
|
||||
let (parsedMedia, _, _, _) = textMediaAndExpirationTimerFromApiMedia(media, account.peerId)
|
||||
if let parsedMedia = parsedMedia, let originalMedia = originalMedia {
|
||||
applyMediaResourceChanges(from: originalMedia, to: parsedMedia, postbox: account.postbox, force: false)
|
||||
@ -1141,7 +1143,7 @@ func _internal_editStoryPrivacy(account: Account, id: Int32, privacy: EngineStor
|
||||
var flags: Int32 = 0
|
||||
flags |= 1 << 2
|
||||
|
||||
return account.network.request(Api.functions.stories.editStory(flags: flags, id: id, media: nil, caption: nil, entities: nil, privacyRules: inputRules))
|
||||
return account.network.request(Api.functions.stories.editStory(flags: flags, id: id, media: nil, mediaAreas: nil, caption: nil, entities: nil, privacyRules: inputRules))
|
||||
|> map(Optional.init)
|
||||
|> `catch` { _ -> Signal<Api.Updates?, NoError> in
|
||||
return .single(nil)
|
||||
@ -1302,7 +1304,7 @@ func _internal_updateStoriesArePinned(account: Account, ids: [Int32: EngineStory
|
||||
extension Api.StoryItem {
|
||||
var id: Int32 {
|
||||
switch self {
|
||||
case let .storyItem(_, id, _, _, _, _, _, _, _):
|
||||
case let .storyItem(_, id, _, _, _, _, _, _, _, _):
|
||||
return id
|
||||
case let .storyItemDeleted(id):
|
||||
return id
|
||||
@ -1328,7 +1330,7 @@ extension Stories.Item.Views {
|
||||
extension Stories.StoredItem {
|
||||
init?(apiStoryItem: Api.StoryItem, peerId: PeerId, transaction: Transaction) {
|
||||
switch apiStoryItem {
|
||||
case let .storyItem(flags, id, date, expireDate, caption, entities, media, privacy, views):
|
||||
case let .storyItem(flags, id, date, expireDate, caption, entities, media, _, privacy, views):
|
||||
let (parsedMedia, _, _, _) = textMediaAndExpirationTimerFromApiMedia(media, peerId)
|
||||
if let parsedMedia = parsedMedia {
|
||||
var parsedPrivacy: Stories.Item.Privacy?
|
||||
@ -1506,7 +1508,7 @@ func _internal_getStoryViewList(account: Account, id: Int32, offsetTimestamp: In
|
||||
var items: [StoryViewList.Item] = []
|
||||
for view in views {
|
||||
switch view {
|
||||
case let .storyView(userId, date):
|
||||
case let .storyView(_, userId, date):
|
||||
if let peer = transaction.getPeer(PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId))) {
|
||||
items.append(StoryViewList.Item(peer: EnginePeer(peer), timestamp: date))
|
||||
}
|
||||
@ -1678,7 +1680,7 @@ public final class EngineStoryViewListContext {
|
||||
var nextOffset: NextOffset?
|
||||
for view in views {
|
||||
switch view {
|
||||
case let .storyView(userId, date):
|
||||
case let .storyView(_, userId, date):
|
||||
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId))
|
||||
if let peer = transaction.getPeer(peerId) {
|
||||
items.append(Item(peer: EnginePeer(peer), timestamp: date, storyStats: transaction.getPeerStoryStats(peerId: peerId)))
|
||||
|
||||
@ -7,7 +7,7 @@ import MtProtoKit
|
||||
|
||||
public func requestBlockedPeers(account: Account) -> Signal<[Peer], NoError> {
|
||||
let accountPeerId = account.peerId
|
||||
return account.network.request(Api.functions.contacts.getBlocked(offset: 0, limit: 100))
|
||||
return account.network.request(Api.functions.contacts.getBlocked(flags: 0, offset: 0, limit: 100))
|
||||
|> retryRequest
|
||||
|> mapToSignal { result -> Signal<[Peer], NoError> in
|
||||
return account.postbox.transaction { transaction -> [Peer] in
|
||||
@ -41,9 +41,9 @@ func _internal_requestUpdatePeerIsBlocked(account: Account, peerId: PeerId, isBl
|
||||
if let peer = transaction.getPeer(peerId), let inputPeer = apiInputPeer(peer) {
|
||||
let signal: Signal<Api.Bool, MTRpcError>
|
||||
if isBlocked {
|
||||
signal = account.network.request(Api.functions.contacts.block(id: inputPeer))
|
||||
signal = account.network.request(Api.functions.contacts.block(flags: 0, id: inputPeer))
|
||||
} else {
|
||||
signal = account.network.request(Api.functions.contacts.unblock(id: inputPeer))
|
||||
signal = account.network.request(Api.functions.contacts.unblock(flags: 0, id: inputPeer))
|
||||
}
|
||||
return signal
|
||||
|> map(Optional.init)
|
||||
|
||||
@ -58,7 +58,7 @@ public final class BlockedPeersContext {
|
||||
self._state = BlockedPeersContextState(isLoadingMore: true, canLoadMore: self._state.canLoadMore, totalCount: self._state.totalCount, peers: self._state.peers)
|
||||
let postbox = self.account.postbox
|
||||
let accountPeerId = self.account.peerId
|
||||
self.disposable.set((self.account.network.request(Api.functions.contacts.getBlocked(offset: Int32(self._state.peers.count), limit: 64))
|
||||
self.disposable.set((self.account.network.request(Api.functions.contacts.getBlocked(flags: 0, offset: Int32(self._state.peers.count), limit: 64))
|
||||
|> retryRequest
|
||||
|> mapToSignal { result -> Signal<(peers: [RenderedPeer], canLoadMore: Bool, totalCount: Int?), NoError> in
|
||||
return postbox.transaction { transaction -> (peers: [RenderedPeer], canLoadMore: Bool, totalCount: Int?) in
|
||||
@ -136,7 +136,7 @@ public final class BlockedPeersContext {
|
||||
guard let inputPeer = inputPeer else {
|
||||
return .fail(.generic)
|
||||
}
|
||||
return network.request(Api.functions.contacts.block(id: inputPeer))
|
||||
return network.request(Api.functions.contacts.block(flags: 0, id: inputPeer))
|
||||
|> mapError { _ -> BlockedPeersContextAddError in
|
||||
return .generic
|
||||
}
|
||||
@ -196,7 +196,7 @@ public final class BlockedPeersContext {
|
||||
guard let inputPeer = inputPeer else {
|
||||
return .fail(.generic)
|
||||
}
|
||||
return network.request(Api.functions.contacts.unblock(id: inputPeer))
|
||||
return network.request(Api.functions.contacts.unblock(flags: 0, id: inputPeer))
|
||||
|> mapError { _ -> BlockedPeersContextRemoveError in
|
||||
return .generic
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user