aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/content-repo.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-06-02 16:45:39 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-06-02 16:45:39 +0900
commit5a5a7251b1bc6f39af17cd00dea2eb6bddd72e1c (patch)
tree8ba6faea582b9f4e0cb2c4c4ea8379b1a8084ca7 /lib/csapi/content-repo.cpp
parent239c33243b21f120f581a646b298950bb18489ee (diff)
downloadlibquotient-5a5a7251b1bc6f39af17cd00dea2eb6bddd72e1c.tar.gz
libquotient-5a5a7251b1bc6f39af17cd00dea2eb6bddd72e1c.zip
csapi: Fix adding omittables to a query string
Diffstat (limited to 'lib/csapi/content-repo.cpp')
-rw-r--r--lib/csapi/content-repo.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/csapi/content-repo.cpp b/lib/csapi/content-repo.cpp
index 101f0ee9..d0efdb9e 100644
--- a/lib/csapi/content-repo.cpp
+++ b/lib/csapi/content-repo.cpp
@@ -159,8 +159,10 @@ class GetContentThumbnailJob::Private
BaseJob::Query queryToGetContentThumbnail(Omittable<int> width, Omittable<int> height, const QString& method)
{
BaseJob::Query _q;
- _q.addQueryItem("width", QString("%1").arg(width));
- _q.addQueryItem("height", QString("%1").arg(height));
+ if (width)
+ _q.addQueryItem("width", QString("%1").arg(width.value()));
+ if (height)
+ _q.addQueryItem("height", QString("%1").arg(height.value()));
if (!method.isEmpty())
_q.addQueryItem("method", method);
return _q;
@@ -213,7 +215,8 @@ BaseJob::Query queryToGetUrlPreview(const QString& url, Omittable<qint64> ts)
{
BaseJob::Query _q;
_q.addQueryItem("url", url);
- _q.addQueryItem("ts", QString("%1").arg(ts));
+ if (ts)
+ _q.addQueryItem("ts", QString("%1").arg(ts.value()));
return _q;
}