aboutsummaryrefslogtreecommitdiff
path: root/lib/events/receiptevent.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-03 17:29:52 +0900
committerGitHub <noreply@github.com>2019-08-03 17:29:52 +0900
commit66e116b7b1e848e80577a0229c8995db0a54932e (patch)
tree763340439a0f4034e9c829d76cb1ffe9766b83c5 /lib/events/receiptevent.cpp
parent5b236dfe895c7766002559570aa29c9033009228 (diff)
parentc05ade838f0fce81f2bbe80a3295618a8a26ff52 (diff)
downloadlibquotient-66e116b7b1e848e80577a0229c8995db0a54932e.tar.gz
libquotient-66e116b7b1e848e80577a0229c8995db0a54932e.zip
Merge pull request #295 from marcdeop/140_impose_coding_standard
140 impose coding standard
Diffstat (limited to 'lib/events/receiptevent.cpp')
-rw-r--r--lib/events/receiptevent.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/events/receiptevent.cpp b/lib/events/receiptevent.cpp
index 47e1398c..4a54b744 100644
--- a/lib/events/receiptevent.cpp
+++ b/lib/events/receiptevent.cpp
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
@@ -40,30 +40,26 @@ Example of a Receipt Event:
using namespace QMatrixClient;
-ReceiptEvent::ReceiptEvent(const QJsonObject& obj)
- : Event(typeId(), obj)
+ReceiptEvent::ReceiptEvent(const QJsonObject& obj) : Event(typeId(), obj)
{
const auto& contents = contentJson();
_eventsWithReceipts.reserve(contents.size());
- for( auto eventIt = contents.begin(); eventIt != contents.end(); ++eventIt )
- {
- if (eventIt.key().isEmpty())
- {
- qCWarning(EPHEMERAL) << "ReceiptEvent has an empty event id, skipping";
+ for (auto eventIt = contents.begin(); eventIt != contents.end(); ++eventIt) {
+ if (eventIt.key().isEmpty()) {
+ qCWarning(EPHEMERAL)
+ << "ReceiptEvent has an empty event id, skipping";
qCDebug(EPHEMERAL) << "ReceiptEvent content follows:\n" << contents;
continue;
}
- const QJsonObject reads = eventIt.value().toObject()
- .value("m.read"_ls).toObject();
+ const QJsonObject reads =
+ eventIt.value().toObject().value("m.read"_ls).toObject();
QVector<Receipt> receipts;
receipts.reserve(reads.size());
- for( auto userIt = reads.begin(); userIt != reads.end(); ++userIt )
- {
+ for (auto userIt = reads.begin(); userIt != reads.end(); ++userIt) {
const QJsonObject user = userIt.value().toObject();
- receipts.push_back({userIt.key(),
- fromJson<QDateTime>(user["ts"_ls])});
+ receipts.push_back(
+ { userIt.key(), fromJson<QDateTime>(user["ts"_ls]) });
}
- _eventsWithReceipts.push_back({eventIt.key(), std::move(receipts)});
+ _eventsWithReceipts.push_back({ eventIt.key(), std::move(receipts) });
}
}
-