diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-07-15 13:07:53 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-15 13:07:53 +0900 |
commit | 3dfb74af71fe0cceaeb14d1ef0ade846f3a659f9 (patch) | |
tree | 40482bd167f1e086541ad71cdf634324b40383c6 /room.cpp | |
parent | 47c2015beb75693c7181fb7359a4aa166e926fe7 (diff) | |
parent | 749def2b983d2338272c0891d15de20df22e2eea (diff) | |
download | libquotient-3dfb74af71fe0cceaeb14d1ef0ade846f3a659f9.tar.gz libquotient-3dfb74af71fe0cceaeb14d1ef0ade846f3a659f9.zip |
Merge pull request #72 from QMatrixClient/kitsune-send-events
Events creation and sending
Diffstat (limited to 'room.cpp')
-rw-r--r-- | room.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -21,14 +21,12 @@ #include <array> #include <QtCore/QHash> -#include <QtCore/QJsonArray> #include <QtCore/QStringBuilder> // for efficient string concats (operator%) #include <QtCore/QElapsedTimer> #include "connection.h" #include "state.h" #include "user.h" -#include "events/roommessageevent.h" #include "events/roomnameevent.h" #include "events/roomaliasesevent.h" #include "events/roomcanonicalaliasevent.h" @@ -36,7 +34,7 @@ #include "events/roommemberevent.h" #include "events/typingevent.h" #include "events/receiptevent.h" -#include "jobs/postmessagejob.h" +#include "jobs/sendeventjob.h" #include "jobs/roommessagesjob.h" #include "jobs/postreceiptjob.h" #include "jobs/leaveroomjob.h" @@ -560,13 +558,18 @@ void Room::updateData(SyncRoomData&& data) void Room::postMessage(const QString& type, const QString& plainText) { - connection()->callApi<PostMessageJob>(id(), type, plainText); + connection()->callApi<SendEventJob>(id(), type, plainText); } -void Room::postMessage(const QString& type, const QString& plainText, - const QString& richText) +void Room::postMessage(const QString& plainText, MessageEventType type) { - connection()->callApi<PostMessageJob>(id(), type, plainText, richText); + RoomMessageEvent rme(plainText, type); + postMessage(&rme); +} + +void Room::postMessage(RoomMessageEvent* event) +{ + connection()->callApi<SendEventJob>(id(), event); } void Room::getPreviousContent(int limit) |