aboutsummaryrefslogtreecommitdiff
path: root/lib/events/event.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/event.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/event.cpp')
-rw-r--r--lib/events/event.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/lib/events/event.cpp b/lib/events/event.cpp
index c98dfbb6..f44b1e5d 100644
--- a/lib/events/event.cpp
+++ b/lib/events/event.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
*/
#include "event.h"
@@ -31,8 +31,8 @@ event_type_t EventTypeRegistry::initializeTypeId(event_mtype_t matrixTypeId)
if (strncmp(matrixTypeId, "", 1) == 0)
qDebug(EVENTS) << "Initialized unknown event type with id" << id;
else
- qDebug(EVENTS) << "Initialized event type" << matrixTypeId
- << "with id" << id;
+ qDebug(EVENTS) << "Initialized event type" << matrixTypeId << "with id"
+ << id;
return id;
}
@@ -41,32 +41,26 @@ QString EventTypeRegistry::getMatrixType(event_type_t typeId)
return typeId < get().eventTypes.size() ? get().eventTypes[typeId] : "";
}
-Event::Event(Type type, const QJsonObject& json)
- : _type(type), _json(json)
+Event::Event(Type type, const QJsonObject& json) : _type(type), _json(json)
{
- if (!json.contains(ContentKeyL) &&
- !json.value(UnsignedKeyL).toObject().contains(RedactedCauseKeyL))
- {
+ if (!json.contains(ContentKeyL)
+ && !json.value(UnsignedKeyL).toObject().contains(RedactedCauseKeyL)) {
qCWarning(EVENTS) << "Event without 'content' node";
qCWarning(EVENTS) << formatJson << json;
}
}
-Event::Event(Type type, event_mtype_t matrixType, const QJsonObject& contentJson)
+Event::Event(Type type, event_mtype_t matrixType,
+ const QJsonObject& contentJson)
: Event(type, basicEventJson(matrixType, contentJson))
-{ }
+{
+}
Event::~Event() = default;
-QString Event::matrixType() const
-{
- return fullJson()[TypeKeyL].toString();
-}
+QString Event::matrixType() const { return fullJson()[TypeKeyL].toString(); }
-QByteArray Event::originalJson() const
-{
- return QJsonDocument(_json).toJson();
-}
+QByteArray Event::originalJson() const { return QJsonDocument(_json).toJson(); }
const QJsonObject Event::contentJson() const
{