diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-19 19:23:10 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-19 19:23:10 +0900 |
commit | 55e0375851c439c97fc353c61d7c8b2b19485082 (patch) | |
tree | ae87f5a06cac202a3ed25afd9e8a433921c2f26a /jobs/generated/inviting.cpp | |
parent | 878248db6122952998b390cf8ff4591c3f144474 (diff) | |
download | libquotient-55e0375851c439c97fc353c61d7c8b2b19485082.tar.gz libquotient-55e0375851c439c97fc353c61d7c8b2b19485082.zip |
Generated jobs: Don't dump empty strings to body parameters
This is important for (soon to be added) LoginJob, since the server is
sensitive to getting an (even empty) entity for "medium" as opposed to
omitting it entirely. This cannot be addressed on the spec level; on the
other hand, removing empty parameters from the payload reduces useless
bytes getting on the wire.
Diffstat (limited to 'jobs/generated/inviting.cpp')
-rw-r--r-- | jobs/generated/inviting.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/jobs/generated/inviting.cpp b/jobs/generated/inviting.cpp index 95ba658d..91760e57 100644 --- a/jobs/generated/inviting.cpp +++ b/jobs/generated/inviting.cpp @@ -15,10 +15,11 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0"); InviteUserJob::InviteUserJob(QString roomId, QString user_id) : BaseJob(HttpVerb::Post, "InviteUserJob", basePath % "/rooms/" % roomId % "/invite", - Query { }, - Data { - { "user_id", toJson(user_id) } - } + Query { } ) -{ } +{ + Data _data; + _data.insert("user_id", toJson(user_id)); + setRequestData(_data); +} |