no message

This commit is contained in:
Ilya Laktyushin 2018-09-07 22:35:45 +03:00
parent 368ecfb3a8
commit 4c8be1544c

View File

@ -1,9 +1,11 @@
#if os(macOS) #if os(macOS)
import PostboxMac import PostboxMac
import SwiftSignalKitMac import SwiftSignalKitMac
import MtProtoKitMac
#else #else
import Postbox import Postbox
import SwiftSignalKit import SwiftSignalKit
import MtProtoKitDynamic
#endif #endif
public typealias AdminLogEventId = Int64 public typealias AdminLogEventId = Int64
@ -116,7 +118,7 @@ public func channelAdminLogEvents(postbox: Postbox, network: Network, peerId: Pe
if let _ = inputAdmins { if let _ = inputAdmins {
flags += Int32(1 << 1) flags += Int32(1 << 1)
} }
return network.request(Api.functions.channels.getAdminLog(flags: flags, channel: inputChannel, q: query ?? "", eventsFilter: eventsFilter, admins: inputAdmins, maxId: maxId, minId: minId, limit: limit)) |> map { result in return network.request(Api.functions.channels.getAdminLog(flags: flags, channel: inputChannel, q: query ?? "", eventsFilter: eventsFilter, admins: inputAdmins, maxId: maxId, minId: minId, limit: limit)) |> mapToSignal { result in
switch result { switch result {
case let .adminLogResults(apiEvents, apiChats, apiUsers): case let .adminLogResults(apiEvents, apiChats, apiUsers):
@ -198,7 +200,11 @@ public func channelAdminLogEvents(postbox: Postbox, network: Network, peerId: Pe
} }
} }
} }
return postbox.transaction { transaction -> AdminLogEventsResult in
updatePeers(transaction: transaction, peers: peers.map { $0.1 }, update: { return $1 })
return AdminLogEventsResult(peerId: peerId, peers: peers, events: events) return AdminLogEventsResult(peerId: peerId, peers: peers, events: events)
} |> introduceError(MTRpcError.self)
} }
} |> mapError {_ in return .generic} } |> mapError {_ in return .generic}