diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-08-11 15:24:41 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-08-11 15:24:41 +0900 |
commit | b028dff6bf6074fdeea5d6f50e97df074f53b45b (patch) | |
tree | c25f3577b2f5e358a58acba5a377e32a286fd0dd /lib/connection.h | |
parent | 62e1550ed842a8a0d4c7b31d788176814a03e814 (diff) | |
download | libquotient-b028dff6bf6074fdeea5d6f50e97df074f53b45b.tar.gz libquotient-b028dff6bf6074fdeea5d6f50e97df074f53b45b.zip |
Connection::*DirectChat(): add overloads accepting User*
Diffstat (limited to 'lib/connection.h')
-rw-r--r-- | lib/connection.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/connection.h b/lib/connection.h index 5d817d69..e761acfd 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -385,6 +385,15 @@ namespace QMatrixClient */ void requestDirectChat(const QString& userId); + /** Get a direct chat with a single user + * This method may return synchronously or asynchoronously depending + * on whether a direct chat room with the respective person exists + * already. + * + * \sa directChatAvailable + */ + void requestDirectChat(const User* u); + /** Run an operation in a direct chat with the user * This method may return synchronously or asynchoronously depending * on whether a direct chat room with the respective person exists @@ -392,7 +401,16 @@ namespace QMatrixClient * function object with the direct chat room as its parameter. */ void doInDirectChat(const QString& userId, - std::function<void(Room*)> operation); + const std::function<void(Room*)>& operation); + + /** Run an operation in a direct chat with the user + * This method may return synchronously or asynchoronously depending + * on whether a direct chat room with the respective person exists + * already. Instead of emitting a signal it executes the passed + * function object with the direct chat room as its parameter. + */ + void doInDirectChat(const User* u, + const std::function<void(Room*)>& operation); /** Create a direct chat with a single user, optional name and topic * A room will always be created, unlike in requestDirectChat. |