aboutsummaryrefslogtreecommitdiff
path: root/lib/events/receiptevent.cpp
diff options
context:
space:
mode:
authorMarc Deop <marc@marcdeop.com>2019-03-02 12:26:57 +0100
committerMarc Deop <marc@marcdeop.com>2019-03-02 12:26:57 +0100
commitaacc4bcb4a487871daae6717f77605aaba444341 (patch)
tree4f50b6874821667ccb6b91c017e5d041e3846112 /lib/events/receiptevent.cpp
parentc971b924cd62822ed6fb1a0291c483ae73a3ecda (diff)
downloadlibquotient-aacc4bcb4a487871daae6717f77605aaba444341.tar.gz
libquotient-aacc4bcb4a487871daae6717f77605aaba444341.zip
style: apply .clang-format to all .cpp and .h files
Diffstat (limited to 'lib/events/receiptevent.cpp')
-rw-r--r--lib/events/receiptevent.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/lib/events/receiptevent.cpp b/lib/events/receiptevent.cpp
index 47e1398c..76c7b6e4 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,27 @@ 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) });
}
}
-