aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs/basejob.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jobs/basejob.h')
-rw-r--r--lib/jobs/basejob.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h
index 4ef25ab8..4c1c7706 100644
--- a/lib/jobs/basejob.h
+++ b/lib/jobs/basejob.h
@@ -64,6 +64,7 @@ namespace QMatrixClient
, IncorrectResponseError
, TooManyRequestsError
, RequestNotImplementedError
+ , UnsupportedRoomVersionError
, NetworkAuthRequiredError
, UserConsentRequiredError
, UserDefinedError = 200
@@ -138,8 +139,20 @@ namespace QMatrixClient
Status status() const;
/** Short human-friendly message on the job status */
QString statusCaption() const;
- /** Raw response body as received from the server */
+ /** Get raw response body as received from the server
+ * \param bytesAtMost return this number of leftmost bytes, or -1
+ * to return the entire response
+ */
QByteArray rawData(int bytesAtMost = -1) const;
+ /** Get UI-friendly sample of raw data
+ *
+ * This is almost the same as rawData but appends the "truncated"
+ * suffix if not all data fit in bytesAtMost. This call is
+ * recommended to present a sample of raw data as "details" next to
+ * error messages. Note that the default \p bytesAtMost value is
+ * also tailored to UI cases.
+ */
+ QString rawDataSample(int bytesAtMost = 65535) const;
/** Error (more generally, status) code
* Equivalent to status().code
@@ -203,9 +216,9 @@ namespace QMatrixClient
*
* In general, to be notified of a job's completion, client code
* should connect to result(), success(), or failure()
- * rather than finished(). However if you store a list of jobs
- * and need to track their lifecycle, then you should connect to this
- * instead of result(), to avoid dangling pointers in your list.
+ * rather than finished(). However if you need to track the job's
+ * lifecycle you should connect to this instead of result();
+ * in particular, only this signal will be emitted on abandoning.
*
* @param job the job that emitted this signal
*