From c165cbe434bab4dab8695517a33f838a41db7953 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 22 Mar 2026 18:41:53 +0100 Subject: [PATCH] Update API --- submodules/TelegramApi/Sources/Api0.swift | 6 +- submodules/TelegramApi/Sources/Api22.swift | 36 +++++++---- submodules/TelegramApi/Sources/Api28.swift | 64 ++++++++++++++----- submodules/TelegramApi/Sources/Api40.swift | 43 +++++++++++++ submodules/TelegramApi/Sources/Api5.swift | 48 ++++++++------ .../ManagedGlobalNotificationSettings.swift | 1 + 6 files changed, 146 insertions(+), 52 deletions(-) diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index 666f4abbf3..b4a2b67461 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -236,7 +236,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[2104790276] = { return Api.DataJSON.parse_dataJSON($0) } dict[414687501] = { return Api.DcOption.parse_dcOption($0) } dict[1135897376] = { return Api.DefaultHistoryTTL.parse_defaultHistoryTTL($0) } - dict[-712374074] = { return Api.Dialog.parse_dialog($0) } + dict[-58066957] = { return Api.Dialog.parse_dialog($0) } dict[1908216652] = { return Api.Dialog.parse_dialogFolder($0) } dict[-1438177711] = { return Api.DialogFilter.parse_dialogFilter($0) } dict[-1772913705] = { return Api.DialogFilter.parse_dialogFilterChatlist($0) } @@ -878,7 +878,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1546531968] = { return Api.ReactionCount.parse_reactionCount($0) } dict[1268654752] = { return Api.ReactionNotificationsFrom.parse_reactionNotificationsFromAll($0) } dict[-1161583078] = { return Api.ReactionNotificationsFrom.parse_reactionNotificationsFromContacts($0) } - dict[1457736048] = { return Api.ReactionsNotifySettings.parse_reactionsNotifySettings($0) } + dict[1910827608] = { return Api.ReactionsNotifySettings.parse_reactionsNotifySettings($0) } dict[1246753138] = { return Api.ReadParticipantDate.parse_readParticipantDate($0) } dict[-1551583367] = { return Api.ReceivedNotifyMessage.parse_receivedNotifyMessage($0) } dict[-1294306862] = { return Api.RecentMeUrl.parse_recentMeUrlChat($0) } @@ -1173,7 +1173,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1216408986] = { return Api.Update.parse_updateManagedBot($0) } dict[-710666460] = { return Api.Update.parse_updateMessageExtendedMedia($0) } dict[1318109142] = { return Api.Update.parse_updateMessageID($0) } - dict[-1398708869] = { return Api.Update.parse_updateMessagePoll($0) } + dict[-699641301] = { return Api.Update.parse_updateMessagePoll($0) } dict[619974263] = { return Api.Update.parse_updateMessagePollVote($0) } dict[506035194] = { return Api.Update.parse_updateMessageReactions($0) } dict[-1618924792] = { return Api.Update.parse_updateMonoForumNoPaidException($0) } diff --git a/submodules/TelegramApi/Sources/Api22.swift b/submodules/TelegramApi/Sources/Api22.swift index 267e01452c..c81b187cd0 100644 --- a/submodules/TelegramApi/Sources/Api22.swift +++ b/submodules/TelegramApi/Sources/Api22.swift @@ -351,17 +351,19 @@ public extension Api { public var flags: Int32 public var messagesNotifyFrom: Api.ReactionNotificationsFrom? public var storiesNotifyFrom: Api.ReactionNotificationsFrom? + public var pollVotesNotifyFrom: Api.ReactionNotificationsFrom? public var sound: Api.NotificationSound public var showPreviews: Api.Bool - public init(flags: Int32, messagesNotifyFrom: Api.ReactionNotificationsFrom?, storiesNotifyFrom: Api.ReactionNotificationsFrom?, sound: Api.NotificationSound, showPreviews: Api.Bool) { + public init(flags: Int32, messagesNotifyFrom: Api.ReactionNotificationsFrom?, storiesNotifyFrom: Api.ReactionNotificationsFrom?, pollVotesNotifyFrom: Api.ReactionNotificationsFrom?, sound: Api.NotificationSound, showPreviews: Api.Bool) { self.flags = flags self.messagesNotifyFrom = messagesNotifyFrom self.storiesNotifyFrom = storiesNotifyFrom + self.pollVotesNotifyFrom = pollVotesNotifyFrom self.sound = sound self.showPreviews = showPreviews } public func descriptionFields() -> (String, [(String, Any)]) { - return ("reactionsNotifySettings", [("flags", self.flags as Any), ("messagesNotifyFrom", self.messagesNotifyFrom as Any), ("storiesNotifyFrom", self.storiesNotifyFrom as Any), ("sound", self.sound as Any), ("showPreviews", self.showPreviews as Any)]) + return ("reactionsNotifySettings", [("flags", self.flags as Any), ("messagesNotifyFrom", self.messagesNotifyFrom as Any), ("storiesNotifyFrom", self.storiesNotifyFrom as Any), ("pollVotesNotifyFrom", self.pollVotesNotifyFrom as Any), ("sound", self.sound as Any), ("showPreviews", self.showPreviews as Any)]) } } case reactionsNotifySettings(Cons_reactionsNotifySettings) @@ -370,7 +372,7 @@ public extension Api { switch self { case .reactionsNotifySettings(let _data): if boxed { - buffer.appendInt32(1457736048) + buffer.appendInt32(1910827608) } serializeInt32(_data.flags, buffer: buffer, boxed: false) if Int(_data.flags) & Int(1 << 0) != 0 { @@ -379,6 +381,9 @@ public extension Api { if Int(_data.flags) & Int(1 << 1) != 0 { _data.storiesNotifyFrom!.serialize(buffer, true) } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.pollVotesNotifyFrom!.serialize(buffer, true) + } _data.sound.serialize(buffer, true) _data.showPreviews.serialize(buffer, true) break @@ -388,7 +393,7 @@ public extension Api { public func descriptionFields() -> (String, [(String, Any)]) { switch self { case .reactionsNotifySettings(let _data): - return ("reactionsNotifySettings", [("flags", _data.flags as Any), ("messagesNotifyFrom", _data.messagesNotifyFrom as Any), ("storiesNotifyFrom", _data.storiesNotifyFrom as Any), ("sound", _data.sound as Any), ("showPreviews", _data.showPreviews as Any)]) + return ("reactionsNotifySettings", [("flags", _data.flags as Any), ("messagesNotifyFrom", _data.messagesNotifyFrom as Any), ("storiesNotifyFrom", _data.storiesNotifyFrom as Any), ("pollVotesNotifyFrom", _data.pollVotesNotifyFrom as Any), ("sound", _data.sound as Any), ("showPreviews", _data.showPreviews as Any)]) } } @@ -407,21 +412,28 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom } } - var _4: Api.NotificationSound? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.NotificationSound + var _4: Api.ReactionNotificationsFrom? + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom + } } - var _5: Api.Bool? + var _5: Api.NotificationSound? if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Bool + _5 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + var _6: Api.Bool? + if let signature = reader.readInt32() { + _6 = 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 - let _c4 = _4 != nil + let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.ReactionsNotifySettings.reactionsNotifySettings(Cons_reactionsNotifySettings(flags: _1!, messagesNotifyFrom: _2, storiesNotifyFrom: _3, sound: _4!, showPreviews: _5!)) + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.ReactionsNotifySettings.reactionsNotifySettings(Cons_reactionsNotifySettings(flags: _1!, messagesNotifyFrom: _2, storiesNotifyFrom: _3, pollVotesNotifyFrom: _4, sound: _5!, showPreviews: _6!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api28.swift b/submodules/TelegramApi/Sources/Api28.swift index 93f0bfae7a..685da34e1b 100644 --- a/submodules/TelegramApi/Sources/Api28.swift +++ b/submodules/TelegramApi/Sources/Api28.swift @@ -1667,17 +1667,23 @@ public extension Api { } public class Cons_updateMessagePoll: TypeConstructorDescription { public var flags: Int32 + public var peer: Api.Peer? + public var msgId: Int32? + public var topMsgId: Int32? public var pollId: Int64 public var poll: Api.Poll? public var results: Api.PollResults - public init(flags: Int32, pollId: Int64, poll: Api.Poll?, results: Api.PollResults) { + public init(flags: Int32, peer: Api.Peer?, msgId: Int32?, topMsgId: Int32?, pollId: Int64, poll: Api.Poll?, results: Api.PollResults) { self.flags = flags + self.peer = peer + self.msgId = msgId + self.topMsgId = topMsgId self.pollId = pollId self.poll = poll self.results = results } public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateMessagePoll", [("flags", self.flags as Any), ("pollId", self.pollId as Any), ("poll", self.poll as Any), ("results", self.results as Any)]) + return ("updateMessagePoll", [("flags", self.flags as Any), ("peer", self.peer as Any), ("msgId", self.msgId as Any), ("topMsgId", self.topMsgId as Any), ("pollId", self.pollId as Any), ("poll", self.poll as Any), ("results", self.results as Any)]) } } public class Cons_updateMessagePollVote: TypeConstructorDescription { @@ -3414,9 +3420,18 @@ public extension Api { break case .updateMessagePoll(let _data): if boxed { - buffer.appendInt32(-1398708869) + buffer.appendInt32(-699641301) } serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.peer!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.msgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } serializeInt64(_data.pollId, buffer: buffer, boxed: false) if Int(_data.flags) & Int(1 << 0) != 0 { _data.poll!.serialize(buffer, true) @@ -4228,7 +4243,7 @@ public extension Api { case .updateMessageID(let _data): return ("updateMessageID", [("id", _data.id as Any), ("randomId", _data.randomId as Any)]) case .updateMessagePoll(let _data): - return ("updateMessagePoll", [("flags", _data.flags as Any), ("pollId", _data.pollId as Any), ("poll", _data.poll as Any), ("results", _data.results as Any)]) + return ("updateMessagePoll", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("topMsgId", _data.topMsgId as Any), ("pollId", _data.pollId as Any), ("poll", _data.poll as Any), ("results", _data.results as Any)]) case .updateMessagePollVote(let _data): return ("updateMessagePollVote", [("pollId", _data.pollId as Any), ("peer", _data.peer as Any), ("options", _data.options as Any), ("qts", _data.qts as Any)]) case .updateMessageReactions(let _data): @@ -5956,24 +5971,41 @@ public extension Api { public static func parse_updateMessagePoll(_ reader: BufferReader) -> Update? { var _1: Int32? _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.Poll? - if Int(_1!) & Int(1 << 0) != 0 { + var _2: Api.Peer? + if Int(_1!) & Int(1 << 1) != 0 { if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Poll + _2 = Api.parse(reader, signature: signature) as? Api.Peer } } - var _4: Api.PollResults? + var _3: Int32? + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } + var _4: Int32? + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } + var _5: Int64? + _5 = reader.readInt64() + var _6: Api.Poll? + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Poll + } + } + var _7: Api.PollResults? if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.PollResults + _7 = Api.parse(reader, signature: signature) as? Api.PollResults } let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateMessagePoll(Cons_updateMessagePoll(flags: _1!, pollId: _2!, poll: _3, results: _4!)) + let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.Update.updateMessagePoll(Cons_updateMessagePoll(flags: _1!, peer: _2, msgId: _3, topMsgId: _4, pollId: _5!, poll: _6, results: _7!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api40.swift b/submodules/TelegramApi/Sources/Api40.swift index 40638dfbb9..8522caec56 100644 --- a/submodules/TelegramApi/Sources/Api40.swift +++ b/submodules/TelegramApi/Sources/Api40.swift @@ -7872,6 +7872,30 @@ public extension Api.functions.messages { }) } } +public extension Api.functions.messages { + static func getUnreadPollVotes(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1126722802) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(addOffset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt32(maxId, buffer: buffer, boxed: false) + serializeInt32(minId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getUnreadPollVotes", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} public extension Api.functions.messages { static func getUnreadReactions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, savedPeerId: Api.InputPeer?, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() @@ -8219,6 +8243,25 @@ public extension Api.functions.messages { }) } } +public extension Api.functions.messages { + static func readPollVotes(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(388019416) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.readPollVotes", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedHistory? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory + } + return result + }) + } +} public extension Api.functions.messages { static func readReactions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, savedPeerId: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() diff --git a/submodules/TelegramApi/Sources/Api5.swift b/submodules/TelegramApi/Sources/Api5.swift index 2f63e2fad5..99d09c7a9b 100644 --- a/submodules/TelegramApi/Sources/Api5.swift +++ b/submodules/TelegramApi/Sources/Api5.swift @@ -1570,12 +1570,13 @@ public extension Api { public var unreadCount: Int32 public var unreadMentionsCount: Int32 public var unreadReactionsCount: Int32 + public var unreadPollVotesCount: Int32 public var notifySettings: Api.PeerNotifySettings public var pts: Int32? public var draft: Api.DraftMessage? public var folderId: Int32? public var ttlPeriod: Int32? - public init(flags: Int32, peer: Api.Peer, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, notifySettings: Api.PeerNotifySettings, pts: Int32?, draft: Api.DraftMessage?, folderId: Int32?, ttlPeriod: Int32?) { + public init(flags: Int32, peer: Api.Peer, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, unreadPollVotesCount: Int32, notifySettings: Api.PeerNotifySettings, pts: Int32?, draft: Api.DraftMessage?, folderId: Int32?, ttlPeriod: Int32?) { self.flags = flags self.peer = peer self.topMessage = topMessage @@ -1584,6 +1585,7 @@ public extension Api { self.unreadCount = unreadCount self.unreadMentionsCount = unreadMentionsCount self.unreadReactionsCount = unreadReactionsCount + self.unreadPollVotesCount = unreadPollVotesCount self.notifySettings = notifySettings self.pts = pts self.draft = draft @@ -1591,7 +1593,7 @@ public extension Api { self.ttlPeriod = ttlPeriod } public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialog", [("flags", self.flags as Any), ("peer", self.peer as Any), ("topMessage", self.topMessage as Any), ("readInboxMaxId", self.readInboxMaxId as Any), ("readOutboxMaxId", self.readOutboxMaxId as Any), ("unreadCount", self.unreadCount as Any), ("unreadMentionsCount", self.unreadMentionsCount as Any), ("unreadReactionsCount", self.unreadReactionsCount as Any), ("notifySettings", self.notifySettings as Any), ("pts", self.pts as Any), ("draft", self.draft as Any), ("folderId", self.folderId as Any), ("ttlPeriod", self.ttlPeriod as Any)]) + return ("dialog", [("flags", self.flags as Any), ("peer", self.peer as Any), ("topMessage", self.topMessage as Any), ("readInboxMaxId", self.readInboxMaxId as Any), ("readOutboxMaxId", self.readOutboxMaxId as Any), ("unreadCount", self.unreadCount as Any), ("unreadMentionsCount", self.unreadMentionsCount as Any), ("unreadReactionsCount", self.unreadReactionsCount as Any), ("unreadPollVotesCount", self.unreadPollVotesCount as Any), ("notifySettings", self.notifySettings as Any), ("pts", self.pts as Any), ("draft", self.draft as Any), ("folderId", self.folderId as Any), ("ttlPeriod", self.ttlPeriod as Any)]) } } public class Cons_dialogFolder: TypeConstructorDescription { @@ -1624,7 +1626,7 @@ public extension Api { switch self { case .dialog(let _data): if boxed { - buffer.appendInt32(-712374074) + buffer.appendInt32(-58066957) } serializeInt32(_data.flags, buffer: buffer, boxed: false) _data.peer.serialize(buffer, true) @@ -1634,6 +1636,7 @@ public extension Api { serializeInt32(_data.unreadCount, buffer: buffer, boxed: false) serializeInt32(_data.unreadMentionsCount, buffer: buffer, boxed: false) serializeInt32(_data.unreadReactionsCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadPollVotesCount, buffer: buffer, boxed: false) _data.notifySettings.serialize(buffer, true) if Int(_data.flags) & Int(1 << 0) != 0 { serializeInt32(_data.pts!, buffer: buffer, boxed: false) @@ -1667,7 +1670,7 @@ public extension Api { public func descriptionFields() -> (String, [(String, Any)]) { switch self { case .dialog(let _data): - return ("dialog", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("unreadMentionsCount", _data.unreadMentionsCount as Any), ("unreadReactionsCount", _data.unreadReactionsCount as Any), ("notifySettings", _data.notifySettings as Any), ("pts", _data.pts as Any), ("draft", _data.draft as Any), ("folderId", _data.folderId as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + return ("dialog", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("unreadMentionsCount", _data.unreadMentionsCount as Any), ("unreadReactionsCount", _data.unreadReactionsCount as Any), ("unreadPollVotesCount", _data.unreadPollVotesCount as Any), ("notifySettings", _data.notifySettings as Any), ("pts", _data.pts as Any), ("draft", _data.draft as Any), ("folderId", _data.folderId as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) case .dialogFolder(let _data): return ("dialogFolder", [("flags", _data.flags as Any), ("folder", _data.folder as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("unreadMutedPeersCount", _data.unreadMutedPeersCount as Any), ("unreadUnmutedPeersCount", _data.unreadUnmutedPeersCount as Any), ("unreadMutedMessagesCount", _data.unreadMutedMessagesCount as Any), ("unreadUnmutedMessagesCount", _data.unreadUnmutedMessagesCount as Any)]) } @@ -1692,28 +1695,30 @@ public extension Api { _7 = reader.readInt32() var _8: Int32? _8 = reader.readInt32() - var _9: Api.PeerNotifySettings? + var _9: Int32? + _9 = reader.readInt32() + var _10: Api.PeerNotifySettings? if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings + _10 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings } - var _10: Int32? + var _11: Int32? if Int(_1!) & Int(1 << 0) != 0 { - _10 = reader.readInt32() + _11 = reader.readInt32() } - var _11: Api.DraftMessage? + var _12: Api.DraftMessage? if Int(_1!) & Int(1 << 1) != 0 { if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.DraftMessage + _12 = Api.parse(reader, signature: signature) as? Api.DraftMessage } } - var _12: Int32? - if Int(_1!) & Int(1 << 4) != 0 { - _12 = reader.readInt32() - } var _13: Int32? - if Int(_1!) & Int(1 << 5) != 0 { + if Int(_1!) & Int(1 << 4) != 0 { _13 = reader.readInt32() } + var _14: Int32? + if Int(_1!) & Int(1 << 5) != 0 { + _14 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1723,12 +1728,13 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil let _c9 = _9 != nil - let _c10 = (Int(_1!) & Int(1 << 0) == 0) || _10 != nil - let _c11 = (Int(_1!) & Int(1 << 1) == 0) || _11 != nil - let _c12 = (Int(_1!) & Int(1 << 4) == 0) || _12 != nil - let _c13 = (Int(_1!) & Int(1 << 5) == 0) || _13 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - return Api.Dialog.dialog(Cons_dialog(flags: _1!, peer: _2!, topMessage: _3!, readInboxMaxId: _4!, readOutboxMaxId: _5!, unreadCount: _6!, unreadMentionsCount: _7!, unreadReactionsCount: _8!, notifySettings: _9!, pts: _10, draft: _11, folderId: _12, ttlPeriod: _13)) + let _c10 = _10 != nil + let _c11 = (Int(_1!) & Int(1 << 0) == 0) || _11 != nil + let _c12 = (Int(_1!) & Int(1 << 1) == 0) || _12 != nil + let _c13 = (Int(_1!) & Int(1 << 4) == 0) || _13 != nil + let _c14 = (Int(_1!) & Int(1 << 5) == 0) || _14 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 { + return Api.Dialog.dialog(Cons_dialog(flags: _1!, peer: _2!, topMessage: _3!, readInboxMaxId: _4!, readOutboxMaxId: _5!, unreadCount: _6!, unreadMentionsCount: _7!, unreadReactionsCount: _8!, unreadPollVotesCount: _9!, notifySettings: _10!, pts: _11, draft: _12, folderId: _13, ttlPeriod: _14)) } else { return nil diff --git a/submodules/TelegramCore/Sources/State/ManagedGlobalNotificationSettings.swift b/submodules/TelegramCore/Sources/State/ManagedGlobalNotificationSettings.swift index 0e401533f2..3c350373f6 100644 --- a/submodules/TelegramCore/Sources/State/ManagedGlobalNotificationSettings.swift +++ b/submodules/TelegramCore/Sources/State/ManagedGlobalNotificationSettings.swift @@ -421,6 +421,7 @@ private func pushedNotificationSettings(network: Network, settings: GlobalNotifi flags: reactionFlags, messagesNotifyFrom: reactionsMessages, storiesNotifyFrom: reactionsStories, + pollVotesNotifyFrom: nil, sound: settings.reactionSettings.sound.apiSound, showPreviews: settings.reactionSettings.hideSender == .hide ? .boolFalse : .boolTrue ))