diff --git a/Telegram/SourceFiles/mtproto/rpc_sender.h b/Telegram/SourceFiles/mtproto/rpc_sender.h index b0c83d59a0..068bd4d323 100644 --- a/Telegram/SourceFiles/mtproto/rpc_sender.h +++ b/Telegram/SourceFiles/mtproto/rpc_sender.h @@ -343,15 +343,17 @@ protected: }; -template +template class RPCDoneHandlerBareOwned : public RPCOwnedDoneHandler { // done(from, end) - using CallbackType = TReturn (TReceiver::*)(const mtpPrime *, const mtpPrime *); + using CallbackType = bool (TReceiver::*)(const mtpPrime *, const mtpPrime *); public: RPCDoneHandlerBareOwned(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { - if (_owner) (static_cast(_owner)->*_onDone)(from, end); + return _owner + ? (static_cast(_owner)->*_onDone)(from, end) + : true; } private: @@ -713,9 +715,9 @@ private: class RPCSender { public: - template // done(from, end) - RPCDoneHandlerPtr rpcDone(TReturn (TReceiver::*onDone)(const mtpPrime *, const mtpPrime *)) { - return RPCDoneHandlerPtr(new RPCDoneHandlerBareOwned(static_cast(this), onDone)); + template // done(from, end) + RPCDoneHandlerPtr rpcDone(bool (TReceiver::*onDone)(const mtpPrime *, const mtpPrime *)) { + return RPCDoneHandlerPtr(new RPCDoneHandlerBareOwned(static_cast(this), onDone)); } template // done(from, end, req_id)