aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'jobs')
-rw-r--r--jobs/sendeventjob.cpp2
-rw-r--r--jobs/sendeventjob.h4
-rw-r--r--jobs/setroomstatejob.h8
3 files changed, 7 insertions, 7 deletions
diff --git a/jobs/sendeventjob.cpp b/jobs/sendeventjob.cpp
index 7e33e089..f5190d4b 100644
--- a/jobs/sendeventjob.cpp
+++ b/jobs/sendeventjob.cpp
@@ -24,7 +24,7 @@ using namespace QMatrixClient;
SendEventJob::SendEventJob(const QString& roomId, const QString& type,
const QString& plainText)
- : SendEventJob(roomId, new RoomMessageEvent(plainText, type))
+ : SendEventJob(roomId, RoomMessageEvent(plainText, type))
{ }
void SendEventJob::beforeStart(const ConnectionData* connData)
diff --git a/jobs/sendeventjob.h b/jobs/sendeventjob.h
index 7b10b3d4..3a11eb6a 100644
--- a/jobs/sendeventjob.h
+++ b/jobs/sendeventjob.h
@@ -29,12 +29,12 @@ namespace QMatrixClient
public:
/** Constructs a job that sends an arbitrary room event */
template <typename EvT>
- SendEventJob(const QString& roomId, const EvT* event)
+ SendEventJob(const QString& roomId, const EvT& event)
: BaseJob(HttpVerb::Put, QStringLiteral("SendEventJob"),
QStringLiteral("_matrix/client/r0/rooms/%1/send/%2/")
.arg(roomId, EvT::TypeId), // See also beforeStart()
Query(),
- Data(event->toJson()))
+ Data(event.toJson()))
{ }
/**
diff --git a/jobs/setroomstatejob.h b/jobs/setroomstatejob.h
index ddc271b9..b7e6d4a1 100644
--- a/jobs/setroomstatejob.h
+++ b/jobs/setroomstatejob.h
@@ -33,24 +33,24 @@ namespace QMatrixClient
*/
template <typename EvT>
SetRoomStateJob(const QString& roomId, const QString& stateKey,
- const EvT* event)
+ const EvT& event)
: BaseJob(HttpVerb::Put, "SetRoomStateJob",
QStringLiteral("_matrix/client/r0/rooms/%1/state/%2/%3")
.arg(roomId, EvT::TypeId, stateKey),
Query(),
- Data(event->toJson()))
+ Data(event.toJson()))
{ }
/**
* Constructs a job that sets a state using an arbitrary room event
* without a state key.
*/
template <typename EvT>
- SetRoomStateJob(const QString& roomId, const EvT* event)
+ SetRoomStateJob(const QString& roomId, const EvT& event)
: BaseJob(HttpVerb::Put, "SetRoomStateJob",
QStringLiteral("_matrix/client/r0/rooms/%1/state/%2")
.arg(roomId, EvT::TypeId),
Query(),
- Data(event->toJson()))
+ Data(event.toJson()))
{ }
QString eventId() const { return _eventId; }