aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsuneRal <KitsuneRal@users.noreply.github.com>2016-07-28 16:49:48 +0900
committerGitHub <noreply@github.com>2016-07-28 16:49:48 +0900
commit67e761a7e62067cd511dee432ebd5f3e8313cecc (patch)
treea37bed075b245debaa24d535895fe3db5df2bbb1
parent3c11f55bfd2b626e330277255bb0c38fbbae84fa (diff)
parentdd2f1f29aa42dc2cbc1fa0163acd3a60e4d86f60 (diff)
downloadlibquotient-67e761a7e62067cd511dee432ebd5f3e8313cecc.tar.gz
libquotient-67e761a7e62067cd511dee432ebd5f3e8313cecc.zip
Merge pull request #14 from Fxrh/kitsune-sync-emits-loginerror
Make sync failure handler emit loginError instead of connectionError in case of access denial
-rw-r--r--connection.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/connection.cpp b/connection.cpp
index 9664521c..38d27a63 100644
--- a/connection.cpp
+++ b/connection.cpp
@@ -117,8 +117,12 @@ SyncJob* Connection::sync(int timeout)
d->processRooms(syncJob->roomData());
emit syncDone();
});
- connect( syncJob, &SyncJob::failure,
- [=] () { emit connectionError(syncJob->errorString());});
+ connect( syncJob, &SyncJob::failure, [=] () {
+ if (syncJob->error() == BaseJob::ContentAccessError)
+ emit loginError(syncJob->errorString());
+ else
+ emit connectionError(syncJob->errorString());
+ });
syncJob->start();
return syncJob;
}