aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--room.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/room.cpp b/room.cpp
index bec4cd30..8ab5b7f5 100644
--- a/room.cpp
+++ b/room.cpp
@@ -744,17 +744,13 @@ void Room::getPreviousContent(int limit)
void Room::Private::getPreviousContent(int limit)
{
- if( !roomMessagesJob )
+ if( !isJobRunning(roomMessagesJob) )
{
roomMessagesJob =
connection->callApi<RoomMessagesJob>(id, prevBatch, limit);
- connect( roomMessagesJob, &RoomMessagesJob::result, [=] {
- if( !roomMessagesJob->error() )
- {
- addHistoricalMessageEvents(roomMessagesJob->releaseEvents());
- prevBatch = roomMessagesJob->end();
- }
- roomMessagesJob = nullptr;
+ connect( roomMessagesJob, &RoomMessagesJob::success, [=] {
+ prevBatch = roomMessagesJob->end();
+ addHistoricalMessageEvents(roomMessagesJob->releaseEvents());
});
}
}