diff --git a/Telegram/NotificationService/Serialization.m b/Telegram/NotificationService/Serialization.m index cce25b19cc..f137bbe5df 100644 --- a/Telegram/NotificationService/Serialization.m +++ b/Telegram/NotificationService/Serialization.m @@ -3,7 +3,7 @@ @implementation Serialization - (NSUInteger)currentLayer { - return 120; + return 119; } - (id _Nullable)parseMessage:(NSData * _Nullable)data { diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index 874ebaa025..8a137c3a69 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -322,7 +322,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[106343499] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsSearch($0) } dict[-1548400251] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsKicked($0) } dict[-1150621555] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsContacts($0) } - dict[-531931925] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsMentions($0) } dict[-350980120] = { return Api.WebPage.parse_webPageEmpty($0) } dict[-981018084] = { return Api.WebPage.parse_webPagePending($0) } dict[-392411726] = { return Api.WebPage.parse_webPage($0) } diff --git a/submodules/TelegramApi/Sources/Api1.swift b/submodules/TelegramApi/Sources/Api1.swift index 1dd38eed77..5a1cdb630c 100644 --- a/submodules/TelegramApi/Sources/Api1.swift +++ b/submodules/TelegramApi/Sources/Api1.swift @@ -9991,7 +9991,6 @@ public extension Api { case channelParticipantsSearch(q: String) case channelParticipantsKicked(q: String) case channelParticipantsContacts(q: String) - case channelParticipantsMentions(flags: Int32, q: String?, topMsgId: Int32?) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -10037,14 +10036,6 @@ public extension Api { } serializeString(q, buffer: buffer, boxed: false) break - case .channelParticipantsMentions(let flags, let q, let topMsgId): - if boxed { - buffer.appendInt32(-531931925) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(q!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - break } } @@ -10064,8 +10055,6 @@ public extension Api { return ("channelParticipantsKicked", [("q", q)]) case .channelParticipantsContacts(let q): return ("channelParticipantsContacts", [("q", q)]) - case .channelParticipantsMentions(let flags, let q, let topMsgId): - return ("channelParticipantsMentions", [("flags", flags), ("q", q), ("topMsgId", topMsgId)]) } } @@ -10122,23 +10111,6 @@ public extension Api { return nil } } - public static func parse_channelParticipantsMentions(_ reader: BufferReader) -> ChannelParticipantsFilter? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } - var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } - 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.ChannelParticipantsFilter.channelParticipantsMentions(flags: _1!, q: _2, topMsgId: _3) - } - else { - return nil - } - } } public enum WebPage: TypeConstructorDescription { diff --git a/submodules/TelegramApi/Sources/Api3.swift b/submodules/TelegramApi/Sources/Api3.swift index e258ce144b..330dc0faa3 100644 --- a/submodules/TelegramApi/Sources/Api3.swift +++ b/submodules/TelegramApi/Sources/Api3.swift @@ -3737,26 +3737,9 @@ public extension Api { }) } - public static func setTyping(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, action: Api.SendMessageAction) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + public static func search(flags: Int32, peer: Api.InputPeer, q: String, fromId: Api.InputUser?, topMsgId: Int32?, filter: Api.MessagesFilter, minDate: Int32, maxDate: Int32, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() - buffer.appendInt32(1486110434) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - action.serialize(buffer, true) - return (FunctionDescription(name: "messages.setTyping", parameters: [("flags", flags), ("peer", peer), ("topMsgId", topMsgId), ("action", action)]), 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 static func search(flags: Int32, peer: Api.InputPeer, q: String, fromId: Api.InputPeer?, topMsgId: Int32?, filter: Api.MessagesFilter, minDate: Int32, maxDate: Int32, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(204812012) + buffer.appendInt32(1310163211) serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) serializeString(q, buffer: buffer, boxed: false) @@ -3780,6 +3763,23 @@ public extension Api { return result }) } + + public static func setTyping(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, action: Api.SendMessageAction) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1486110434) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} + action.serialize(buffer, true) + return (FunctionDescription(name: "messages.setTyping", parameters: [("flags", flags), ("peer", peer), ("topMsgId", topMsgId), ("action", action)]), 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 struct channels { public static func readHistory(channel: Api.InputChannel, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { diff --git a/submodules/TelegramCore/Sources/ChannelMembers.swift b/submodules/TelegramCore/Sources/ChannelMembers.swift index 2fe9cbed67..7c63ae948b 100644 --- a/submodules/TelegramCore/Sources/ChannelMembers.swift +++ b/submodules/TelegramCore/Sources/ChannelMembers.swift @@ -34,7 +34,8 @@ public func channelMembers(postbox: Postbox, network: Network, accountPeerId: Pe apiFilter = .channelParticipantsSearch(q: query) } case let .mentions(threadId, filter): - switch filter { + return .single([]) + /*switch filter { case .all: var flags: Int32 = 0 if threadId != nil { @@ -50,7 +51,7 @@ public func channelMembers(postbox: Postbox, network: Network, accountPeerId: Pe flags |= 1 << 0 } apiFilter = .channelParticipantsMentions(flags: flags, q: query.isEmpty ? nil : query, topMsgId: threadId?.id) - } + }*/ case .admins: apiFilter = .channelParticipantsAdmins case let .contacts(filter): diff --git a/submodules/TelegramCore/Sources/SearchMessages.swift b/submodules/TelegramCore/Sources/SearchMessages.swift index 9cbc767ec6..f22a2fa6c0 100644 --- a/submodules/TelegramCore/Sources/SearchMessages.swift +++ b/submodules/TelegramCore/Sources/SearchMessages.swift @@ -221,10 +221,10 @@ public func searchMessages(account: Account, location: SearchMessagesLocation, q guard let inputPeer = apiInputPeer(peer) else { return .single((nil, nil)) } - var fromInputPeer: Api.InputPeer? = nil + var fromInputPeer: Api.InputUser? = nil var flags: Int32 = 0 if let from = values.from { - fromInputPeer = apiInputPeer(from) + fromInputPeer = apiInputUser(from) if let _ = fromInputPeer { flags |= (1 << 0) } diff --git a/submodules/TelegramCore/Sources/Serialization.swift b/submodules/TelegramCore/Sources/Serialization.swift index d03f659a53..94cd1882c6 100644 --- a/submodules/TelegramCore/Sources/Serialization.swift +++ b/submodules/TelegramCore/Sources/Serialization.swift @@ -210,7 +210,7 @@ public class BoxedMessage: NSObject { public class Serialization: NSObject, MTSerialization { public func currentLayer() -> UInt { - return 120 + return 119 } public func parseMessage(_ data: Data!) -> Any! { diff --git a/submodules/TelegramUI/Sources/ChatSearchInputPanelNode.swift b/submodules/TelegramUI/Sources/ChatSearchInputPanelNode.swift index 8cbe14652a..0f88c5822b 100644 --- a/submodules/TelegramUI/Sources/ChatSearchInputPanelNode.swift +++ b/submodules/TelegramUI/Sources/ChatSearchInputPanelNode.swift @@ -189,6 +189,9 @@ final class ChatSearchInputPanelNode: ChatInputPanelNode { canSearchMembers = false } } + if case .replyThread = interfaceState.chatLocation { + canSearchMembers = false + } self.membersButton.isHidden = (!(interfaceState.search?.query.isEmpty ?? true)) || self.displayActivity || !canSearchMembers let resultsEnabled = (resultCount ?? 0) > 0