From 4cbe1a5fe9b0ae17e89425c3127db2af9b328320 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 4 May 2018 12:12:07 +0900 Subject: Preempt job/setroomstatejob.* with jobs/generated/room_state.* The template part (not exposed in the auto-generated class) goes to Room::Private::requestSetState(). Also, Room::setMemberState() to interface with User class. --- lib/user.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/user.cpp') diff --git a/lib/user.cpp b/lib/user.cpp index 89e324f9..5c380424 100644 --- a/lib/user.cpp +++ b/lib/user.cpp @@ -23,7 +23,7 @@ #include "avatar.h" #include "events/event.h" #include "events/roommemberevent.h" -#include "jobs/setroomstatejob.h" +#include "jobs/generated/room_state.h" #include "jobs/generated/profile.h" #include "jobs/generated/content-repo.h" @@ -277,8 +277,7 @@ void User::rename(const QString& newName, const Room* r) "Attempt to rename a user that's not a room member"); MemberEventContent evtC; evtC.displayName = newName; - auto job = d->connection->callApi( - r->id(), id(), RoomMemberEvent(move(evtC))); + auto job = r->setMemberState(id(), RoomMemberEvent(move(evtC))); connect(job, &BaseJob::success, this, [=] { updateName(newName, r); }); } -- cgit v1.2.3