aboutsummaryrefslogtreecommitdiff
path: root/connection.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2016-08-31 17:49:43 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2016-08-31 17:50:56 +0900
commit76241cb772bb53901cdd3308262f76ba718d9a47 (patch)
tree3c4c761384caca211c6647871b7ac62528b5eb50 /connection.h
parentc02174bc8f09761c2e4ee3ca4a250ce49025343e (diff)
downloadlibquotient-76241cb772bb53901cdd3308262f76ba718d9a47.tar.gz
libquotient-76241cb772bb53901cdd3308262f76ba718d9a47.zip
Dismiss ConnectionPrivate, long live Connection::Private
Closer investigation found out that there are only two actually used member functions in ConnectionPrivate - provideRoom() and resolveServer(). These two have been transferred to Connection; and data members from ConnectionPrivate found new home in Connection::Private. Factoring out room management and user management from Connection is still a pending task.
Diffstat (limited to 'connection.h')
-rw-r--r--connection.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/connection.h b/connection.h
index f3a15cba..2816895e 100644
--- a/connection.h
+++ b/connection.h
@@ -55,7 +55,7 @@ namespace QMatrixClient
Q_INVOKABLE virtual PostReceiptJob* postReceipt( Room* room, Event* event );
Q_INVOKABLE virtual void joinRoom( QString roomAlias );
Q_INVOKABLE virtual void leaveRoom( Room* room );
- Q_INVOKABLE virtual void getMembers( Room* room );
+// Q_INVOKABLE virtual void getMembers( Room* room );
Q_INVOKABLE virtual RoomMessagesJob* getMessages( Room* room, QString from );
virtual MediaThumbnailJob* getThumbnail( QUrl url, int requestedWidth, int requestedHeight );
@@ -81,11 +81,22 @@ namespace QMatrixClient
protected:
/**
- * Access the underlying ConnectionData class
+ * @brief Access the underlying ConnectionData class
*/
ConnectionData* connectionData();
/**
+ * @brief Find a (possibly new) Room object for the specified id
+ * Use this method whenever you need to find a Room object in
+ * the local list of rooms. Note that this does not interact with
+ * the server; in particular, does not automatically create rooms
+ * on the server.
+ * @return a pointer to a Room object with the specified id; nullptr
+ * if roomId is empty if createRoom() failed to create a Room object.
+ */
+ Room* provideRoom(QString roomId);
+
+ /**
* makes it possible for derived classes to have its own User class
*/
virtual User* createUser(QString userId);
@@ -96,8 +107,8 @@ namespace QMatrixClient
virtual Room* createRoom(QString roomId);
private:
- friend class ConnectionPrivate;
- ConnectionPrivate* d;
+ class Private;
+ Private* d;
};
}