| 1 | /****************************************************************************** |
| 2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
| 3 | */ |
| 4 | |
| 5 | #pragma once |
| 6 | |
| 7 | #include <Quotient/jobs/basejob.h> |
| 8 | |
| 9 | namespace Quotient { |
| 10 | |
| 11 | /*! \brief Knock on a room, requesting permission to join. |
| 12 | * |
| 13 | * *Note that this API takes either a room ID or alias, unlike other membership |
| 14 | * APIs.* |
| 15 | * |
| 16 | * This API "knocks" on the room to ask for permission to join, if the user |
| 17 | * is allowed to knock on the room. Acceptance of the knock happens out of |
| 18 | * band from this API, meaning that the client will have to watch for updates |
| 19 | * regarding the acceptance/rejection of the knock. |
| 20 | * |
| 21 | * If the room history settings allow, the user will still be able to see |
| 22 | * history of the room while being in the "knock" state. The user will have |
| 23 | * to accept the invitation to join the room (acceptance of knock) to see |
| 24 | * messages reliably. See the `/join` endpoints for more information about |
| 25 | * history visibility to the user. |
| 26 | * |
| 27 | * The knock will appear as an entry in the response of the |
| 28 | * [`/sync`](/client-server-api/#get_matrixclientv3sync) API. |
| 29 | */ |
| 30 | class QUOTIENT_API KnockRoomJob : public BaseJob { |
| 31 | public: |
| 32 | /*! \brief Knock on a room, requesting permission to join. |
| 33 | * |
| 34 | * \param roomIdOrAlias |
| 35 | * The room identifier or alias to knock upon. |
| 36 | * |
| 37 | * \param serverName |
| 38 | * The servers to attempt to knock on the room through. One of the servers |
| 39 | * must be participating in the room. |
| 40 | * |
| 41 | * \param reason |
| 42 | * Optional reason to be included as the `reason` on the subsequent |
| 43 | * membership event. |
| 44 | */ |
| 45 | explicit KnockRoomJob(const QString& roomIdOrAlias, |
| 46 | const QStringList& serverName = {}, |
| 47 | const QString& reason = {}); |
| 48 | |
| 49 | // Result properties |
| 50 | |
| 51 | /// The knocked room ID. |
| 52 | QString roomId() const { return loadFromJson<QString>(keyName: "room_id"_ls ); } |
| 53 | }; |
| 54 | |
| 55 | } // namespace Quotient |
| 56 | |