diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connection.cpp | 8 | ||||
-rw-r--r-- | lib/room.h | 12 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 8d55460d..4a24de09 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -649,14 +649,14 @@ ForgetRoomJob* Connection::forgetRoom(const QString& id) forgetJob->start(connectionData()); connect(forgetJob, &BaseJob::success, this, [this, id] { - // If the room is in the map (possibly in both forms), delete all forms. + // Delete whatever instances of the room are still in the map. for (auto f: {false, true}) if (auto r = d->roomMap.take({ id, f })) { - emit aboutToDeleteRoom(r); - qCDebug(MAIN) << "Room" << id - << "in join state" << toCString(r->joinState()) + qCDebug(MAIN) << "Room" << r->objectName() + << "in state" << toCString(r->joinState()) << "will be deleted"; + emit aboutToDeleteRoom(r); r->deleteLater(); } }); @@ -301,10 +301,6 @@ namespace QMatrixClient MemberSorter memberSorter() const; - QJsonObject toJson() const; - void updateData(SyncRoomData&& data ); - void setJoinState( JoinState state ); - public slots: QString postMessage(const QString& plainText, MessageEventType type); QString postPlainText(const QString& plainText); @@ -404,6 +400,14 @@ namespace QMatrixClient void fileTransferFailed(QString id, QString errorMessage = {}); void fileTransferCancelled(QString id); + public: // Used by Connection - not a part of the client API + QJsonObject toJson() const; + void updateData(SyncRoomData&& data ); + + // Clients should use Connection::joinRoom() and Room::leaveRoom() + // to change the room state + void setJoinState( JoinState state ); + protected: /// Returns true if any of room names/aliases has changed virtual bool processStateEvent(const RoomEvent& e); |