aboutsummaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
Diffstat (limited to 'events')
-rw-r--r--events/event.h7
-rw-r--r--events/receiptevent.cpp4
-rw-r--r--events/receiptevent.h6
-rw-r--r--events/roomaliasesevent.cpp1
-rw-r--r--events/roomaliasesevent.h5
-rw-r--r--events/roomcanonicalaliasevent.h5
-rw-r--r--events/roommemberevent.cpp1
-rw-r--r--events/roommemberevent.h5
-rw-r--r--events/roommessageevent.cpp1
-rw-r--r--events/roommessageevent.h11
-rw-r--r--events/roomnameevent.h5
-rw-r--r--events/roomtopicevent.h5
-rw-r--r--events/typingevent.h5
-rw-r--r--events/unknownevent.h5
14 files changed, 14 insertions, 52 deletions
diff --git a/events/event.h b/events/event.h
index 2e5e5da1..12b0ebd5 100644
--- a/events/event.h
+++ b/events/event.h
@@ -16,10 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_EVENT_H
-#define QMATRIXCLIENT_EVENT_H
-
-#include <algorithm>
+#pragma once
#include <QtCore/QString>
#include <QtCore/QDateTime>
@@ -112,5 +109,3 @@ namespace QMatrixClient
return fallback;
}
}
-
-#endif // QMATRIXCLIENT_EVENT_H
diff --git a/events/receiptevent.cpp b/events/receiptevent.cpp
index 29d78a20..74e89ba2 100644
--- a/events/receiptevent.cpp
+++ b/events/receiptevent.cpp
@@ -35,13 +35,11 @@ Example of a Receipt Event:
#include "receiptevent.h"
-#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
#include <QtCore/QDebug>
using namespace QMatrixClient;
-
class ReceiptEvent::Private
{
public:
@@ -83,7 +81,7 @@ ReceiptEvent* ReceiptEvent::fromJson(const QJsonObject& obj)
{
const QJsonObject user = reads[userId].toObject();
const QDateTime time = QDateTime::fromMSecsSinceEpoch( (quint64) user["ts"].toDouble(), Qt::UTC );
- receipts.push_back({ eventId, userId, time });
+ receipts.push_back({ userId, time });
}
e->d->eventToReceipts.insert(eventId, receipts);
}
diff --git a/events/receiptevent.h b/events/receiptevent.h
index cf08fed9..5ca33f75 100644
--- a/events/receiptevent.h
+++ b/events/receiptevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_RECEIPTEVENT_H
-#define QMATRIXCLIENT_RECEIPTEVENT_H
+#pragma once
#include "event.h"
@@ -28,7 +27,6 @@ namespace QMatrixClient
class Receipt
{
public:
- QString eventId;
QString userId;
QDateTime timestamp;
};
@@ -56,5 +54,3 @@ namespace QMatrixClient
Private* d;
};
}
-
-#endif // QMATRIXCLIENT_RECEIPTEVENT_H
diff --git a/events/roomaliasesevent.cpp b/events/roomaliasesevent.cpp
index 15b4c54e..9c64e40c 100644
--- a/events/roomaliasesevent.cpp
+++ b/events/roomaliasesevent.cpp
@@ -34,7 +34,6 @@
#include "roomaliasesevent.h"
-#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
#include <QtCore/QDebug>
diff --git a/events/roomaliasesevent.h b/events/roomaliasesevent.h
index 89ea63b8..8f638be2 100644
--- a/events/roomaliasesevent.h
+++ b/events/roomaliasesevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_ROOMALIASESEVENT_H
-#define QMATRIXCLIENT_ROOMALIASESEVENT_H
+#pragma once
#include "event.h"
@@ -40,5 +39,3 @@ namespace QMatrixClient
Private* d;
};
}
-
-#endif // QMATRIXCLIENT_ROOMALIASESEVENT_H \ No newline at end of file
diff --git a/events/roomcanonicalaliasevent.h b/events/roomcanonicalaliasevent.h
index f3ab8e5a..87219be6 100644
--- a/events/roomcanonicalaliasevent.h
+++ b/events/roomcanonicalaliasevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_ROOMCANONICALALIASEVENT_H
-#define QMATRIXCLIENT_ROOMCANONICALALIASEVENT_H
+#pragma once
#include "event.h"
@@ -38,5 +37,3 @@ namespace QMatrixClient
Private* d;
};
}
-
-#endif // QMATRIXCLIENT_ROOMCANONICALALIASEVENT_H \ No newline at end of file
diff --git a/events/roommemberevent.cpp b/events/roommemberevent.cpp
index e58bda8f..93b4bb32 100644
--- a/events/roommemberevent.cpp
+++ b/events/roommemberevent.cpp
@@ -19,7 +19,6 @@
#include "roommemberevent.h"
#include <QtCore/QDebug>
-#include <QtCore/QUrl>
using namespace QMatrixClient;
diff --git a/events/roommemberevent.h b/events/roommemberevent.h
index e47013cb..f37cdc04 100644
--- a/events/roommemberevent.h
+++ b/events/roommemberevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_ROOMMEMBEREVENT_H
-#define QMATRIXCLIENT_ROOMMEMBEREVENT_H
+#pragma once
#include <QtCore/QJsonObject>
#include <QtCore/QUrl>
@@ -46,5 +45,3 @@ namespace QMatrixClient
Private* d;
};
}
-
-#endif // QMATRIXCLIENT_ROOMMEMBEREVENT_H
diff --git a/events/roommessageevent.cpp b/events/roommessageevent.cpp
index 76152102..bb28d682 100644
--- a/events/roommessageevent.cpp
+++ b/events/roommessageevent.cpp
@@ -18,7 +18,6 @@
#include "roommessageevent.h"
-#include <QtCore/QJsonObject>
#include <QtCore/QMimeDatabase>
#include <QtCore/QDebug>
diff --git a/events/roommessageevent.h b/events/roommessageevent.h
index 591b2df9..67789ef7 100644
--- a/events/roommessageevent.h
+++ b/events/roommessageevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_ROOMMESSAGEEVENT_H
-#define QMATRIXCLIENT_ROOMMESSAGEEVENT_H
+#pragma once
#include <QtCore/QUrl>
#include <QtCore/QMimeType>
@@ -42,7 +41,7 @@ namespace QMatrixClient
public:
RoomMessageEvent();
virtual ~RoomMessageEvent();
-
+
QString userId() const;
MessageEventType msgtype() const;
@@ -57,9 +56,9 @@ namespace QMatrixClient
QString body() const;
MessageEventContent::Base* content() const;
-
+
static RoomMessageEvent* fromJson( const QJsonObject& obj );
-
+
private:
class Private;
Private* d;
@@ -145,5 +144,3 @@ namespace QMatrixClient
using AudioContent = ThumbnailedContent<AudioInfo>;
}
}
-
-#endif // QMATRIXCLIENT_ROOMMESSAGEEVENT_H
diff --git a/events/roomnameevent.h b/events/roomnameevent.h
index 436a1dd4..0997ad9c 100644
--- a/events/roomnameevent.h
+++ b/events/roomnameevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_ROOMNAMEEVENT_H
-#define QMATRIXCLIENT_ROOMNAMEEVENT_H
+#pragma once
#include "event.h"
@@ -40,5 +39,3 @@ private:
};
}
-
-#endif // QMATRIXCLIENT_ROOMNAMEEVENT_H
diff --git a/events/roomtopicevent.h b/events/roomtopicevent.h
index f4d87eef..d4347953 100644
--- a/events/roomtopicevent.h
+++ b/events/roomtopicevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_ROOMTOPICEVENT_H
-#define QMATRIXCLIENT_ROOMTOPICEVENT_H
+#pragma once
#include <QtCore/QJsonObject>
@@ -40,5 +39,3 @@ namespace QMatrixClient
Private* d;
};
}
-
-#endif // QMATRIXCLIENT_ROOMTOPICEVENT_H
diff --git a/events/typingevent.h b/events/typingevent.h
index 2625dc66..5a8b045c 100644
--- a/events/typingevent.h
+++ b/events/typingevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_TYPINGEVENT_H
-#define QMATRIXCLIENT_TYPINGEVENT_H
+#pragma once
#include <QtCore/QStringList>
@@ -40,5 +39,3 @@ namespace QMatrixClient
Private* d;
};
}
-
-#endif // QMATRIXCLIENT_TYPINGEVENT_H
diff --git a/events/unknownevent.h b/events/unknownevent.h
index 58493095..51f2c4be 100644
--- a/events/unknownevent.h
+++ b/events/unknownevent.h
@@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef QMATRIXCLIENT_UNKNOWNEVENT_H
-#define QMATRIXCLIENT_UNKNOWNEVENT_H
+#pragma once
#include "event.h"
@@ -39,5 +38,3 @@ namespace QMatrixClient
Private* d;
};
}
-
-#endif // QMATRIXCLIENT_UNKNOWNEVENT_H \ No newline at end of file