From 23672cbb025814f2d8d6960f72ab602ef7a55b41 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Fri, 17 Jun 2022 22:59:45 +0200 Subject: room.cpp: replace two signal connections with one --- lib/room.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/room.cpp b/lib/room.cpp index e07de123..2d4cfeb4 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -2057,10 +2057,11 @@ QString Room::Private::doSendEvent(const RoomEvent* pEvent) it->setDeparted(); emit q->pendingEventChanged(int(it - unsyncedEvents.begin())); }); - Room::connect(call, &BaseJob::failure, q, - std::bind(&Room::Private::onEventSendingFailure, this, - txnId, call)); - Room::connect(call, &BaseJob::success, q, [this, call, txnId] { + Room::connect(call, &BaseJob::result, q, [this, txnId, call] { + if (!call->status().good()) { + onEventSendingFailure(txnId, call); + return; + } auto it = q->findPendingEvent(txnId); if (it != unsyncedEvents.end()) { if (it->deliveryStatus() != EventStatus::ReachedServer) { -- cgit v1.2.3