diff options
-rw-r--r-- | lib/csapi/admin.h | 5 | ||||
-rw-r--r-- | lib/csapi/content-repo.h | 35 | ||||
-rw-r--r-- | lib/csapi/create_room.h | 5 | ||||
-rw-r--r-- | lib/csapi/device_management.h | 5 | ||||
-rw-r--r-- | lib/csapi/directory.h | 5 | ||||
-rw-r--r-- | lib/csapi/event_context.h | 20 | ||||
-rw-r--r-- | lib/csapi/filter.h | 10 | ||||
-rw-r--r-- | lib/csapi/joining.h | 10 | ||||
-rw-r--r-- | lib/csapi/keys.h | 5 | ||||
-rw-r--r-- | lib/csapi/knocking.h | 5 | ||||
-rw-r--r-- | lib/csapi/list_public_rooms.h | 20 | ||||
-rw-r--r-- | lib/csapi/login.h | 10 | ||||
-rw-r--r-- | lib/csapi/message_pagination.h | 20 | ||||
-rw-r--r-- | lib/csapi/notifications.h | 5 | ||||
-rw-r--r-- | lib/csapi/openid.h | 5 | ||||
-rw-r--r-- | lib/csapi/peeking_events.h | 15 | ||||
-rw-r--r-- | lib/csapi/presence.h | 10 | ||||
-rw-r--r-- | lib/csapi/profile.h | 10 | ||||
-rw-r--r-- | lib/csapi/pushrules.h | 10 | ||||
-rw-r--r-- | lib/csapi/redaction.h | 5 | ||||
-rw-r--r-- | lib/csapi/registration.h | 10 | ||||
-rw-r--r-- | lib/csapi/room_send.h | 5 | ||||
-rw-r--r-- | lib/csapi/room_state.h | 5 | ||||
-rw-r--r-- | lib/csapi/rooms.h | 12 | ||||
-rw-r--r-- | lib/csapi/users.h | 5 | ||||
-rw-r--r-- | lib/csapi/voip.h | 5 | ||||
-rw-r--r-- | lib/csapi/whoami.h | 10 |
27 files changed, 53 insertions, 214 deletions
diff --git a/lib/csapi/admin.h b/lib/csapi/admin.h index d4fe639b..570bf24a 100644 --- a/lib/csapi/admin.h +++ b/lib/csapi/admin.h @@ -74,10 +74,7 @@ public: // Result properties /// The Matrix user ID of the user. - QString userId() const - { - return loadFromJson<QString>("user_id"_ls); - } + QString userId() const { return loadFromJson<QString>("user_id"_ls); } /// Each key is an identifier for one of the user's devices. QHash<QString, DeviceInfo> devices() const diff --git a/lib/csapi/content-repo.h b/lib/csapi/content-repo.h index a41453b2..f3d7309a 100644 --- a/lib/csapi/content-repo.h +++ b/lib/csapi/content-repo.h @@ -72,10 +72,7 @@ public: // Result properties /// The content type of the file that was previously uploaded. - QString contentType() const - { - return reply()->rawHeader("Content-Type"); - } + QString contentType() const { return reply()->rawHeader("Content-Type"); } /// The name of the file that was previously uploaded, if set. QString contentDisposition() const @@ -84,10 +81,7 @@ public: } /// The content that was previously uploaded. - QIODevice* data() - { - return reply(); - } + QIODevice* data() { return reply(); } }; /*! \brief Download content from the content repository overriding the file name @@ -132,10 +126,7 @@ public: // Result properties /// The content type of the file that was previously uploaded. - QString contentType() const - { - return reply()->rawHeader("Content-Type"); - } + QString contentType() const { return reply()->rawHeader("Content-Type"); } /// The `fileName` requested or the name of the file that was previously /// uploaded, if set. @@ -145,10 +136,7 @@ public: } /// The content that was previously uploaded. - QIODevice* data() - { - return reply(); - } + QIODevice* data() { return reply(); } }; /*! \brief Download a thumbnail of content from the content repository @@ -202,16 +190,10 @@ public: // Result properties /// The content type of the thumbnail. - QString contentType() const - { - return reply()->rawHeader("Content-Type"); - } + QString contentType() const { return reply()->rawHeader("Content-Type"); } /// A thumbnail of the requested content. - QIODevice* data() - { - return reply(); - } + QIODevice* data() { return reply(); } }; /*! \brief Get information about a URL for a client @@ -257,10 +239,7 @@ public: /// An [MXC URI](/client-server-api/#matrix-content-mxc-uris) to the image. /// Omitted if there is no image. - QString ogImage() const - { - return loadFromJson<QString>("og:image"_ls); - } + QString ogImage() const { return loadFromJson<QString>("og:image"_ls); } }; /*! \brief Get the configuration for the content repository. diff --git a/lib/csapi/create_room.h b/lib/csapi/create_room.h index 8c6af7d4..81dfbffc 100644 --- a/lib/csapi/create_room.h +++ b/lib/csapi/create_room.h @@ -268,10 +268,7 @@ public: // Result properties /// The created room's ID. - QString roomId() const - { - return loadFromJson<QString>("room_id"_ls); - } + QString roomId() const { return loadFromJson<QString>("room_id"_ls); } }; template <> diff --git a/lib/csapi/device_management.h b/lib/csapi/device_management.h index e2acea18..7fb69873 100644 --- a/lib/csapi/device_management.h +++ b/lib/csapi/device_management.h @@ -59,10 +59,7 @@ public: // Result properties /// Device information - Device device() const - { - return fromJson<Device>(jsonData()); - } + Device device() const { return fromJson<Device>(jsonData()); } }; /*! \brief Update a device diff --git a/lib/csapi/directory.h b/lib/csapi/directory.h index 00215cae..93a31595 100644 --- a/lib/csapi/directory.h +++ b/lib/csapi/directory.h @@ -51,10 +51,7 @@ public: // Result properties /// The room ID for this room alias. - QString roomId() const - { - return loadFromJson<QString>("room_id"_ls); - } + QString roomId() const { return loadFromJson<QString>("room_id"_ls); } /// A list of servers that are aware of this room alias. QStringList servers() const diff --git a/lib/csapi/event_context.h b/lib/csapi/event_context.h index 6a49769f..4e50edf3 100644 --- a/lib/csapi/event_context.h +++ b/lib/csapi/event_context.h @@ -58,16 +58,10 @@ public: // Result properties /// A token that can be used to paginate backwards with. - QString begin() const - { - return loadFromJson<QString>("start"_ls); - } + QString begin() const { return loadFromJson<QString>("start"_ls); } /// A token that can be used to paginate forwards with. - QString end() const - { - return loadFromJson<QString>("end"_ls); - } + QString end() const { return loadFromJson<QString>("end"_ls); } /// A list of room events that happened just before the /// requested event, in reverse-chronological order. @@ -77,10 +71,7 @@ public: } /// Details of the requested event. - RoomEventPtr event() - { - return takeFromJson<RoomEventPtr>("event"_ls); - } + RoomEventPtr event() { return takeFromJson<RoomEventPtr>("event"_ls); } /// A list of room events that happened just after the /// requested event, in chronological order. @@ -90,10 +81,7 @@ public: } /// The state of the room at the last event returned. - StateEvents state() - { - return takeFromJson<StateEvents>("state"_ls); - } + StateEvents state() { return takeFromJson<StateEvents>("state"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/filter.h b/lib/csapi/filter.h index 7e9e14ee..01bec36b 100644 --- a/lib/csapi/filter.h +++ b/lib/csapi/filter.h @@ -35,10 +35,7 @@ public: /// with a `{` as this character is used to determine /// if the filter provided is inline JSON or a previously /// declared filter by homeservers on some APIs. - QString filterId() const - { - return loadFromJson<QString>("filter_id"_ls); - } + QString filterId() const { return loadFromJson<QString>("filter_id"_ls); } }; /*! \brief Download a filter @@ -67,10 +64,7 @@ public: // Result properties /// The filter definition. - Filter filter() const - { - return fromJson<Filter>(jsonData()); - } + Filter filter() const { return fromJson<Filter>(jsonData()); } }; } // namespace Quotient diff --git a/lib/csapi/joining.h b/lib/csapi/joining.h index 6dcd1351..d0199b11 100644 --- a/lib/csapi/joining.h +++ b/lib/csapi/joining.h @@ -49,10 +49,7 @@ public: // Result properties /// The joined room ID. - QString roomId() const - { - return loadFromJson<QString>("room_id"_ls); - } + QString roomId() const { return loadFromJson<QString>("room_id"_ls); } }; /*! \brief Start the requesting user participating in a particular room. @@ -98,10 +95,7 @@ public: // Result properties /// The joined room ID. - QString roomId() const - { - return loadFromJson<QString>("room_id"_ls); - } + QString roomId() const { return loadFromJson<QString>("room_id"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/keys.h b/lib/csapi/keys.h index 53ba6495..7db09e8d 100644 --- a/lib/csapi/keys.h +++ b/lib/csapi/keys.h @@ -267,10 +267,7 @@ public: /// The Matrix User IDs of all users who may have left all /// the end-to-end encrypted rooms they previously shared /// with the user. - QStringList left() const - { - return loadFromJson<QStringList>("left"_ls); - } + QStringList left() const { return loadFromJson<QStringList>("left"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/knocking.h b/lib/csapi/knocking.h index 607b55a9..1108cb64 100644 --- a/lib/csapi/knocking.h +++ b/lib/csapi/knocking.h @@ -49,10 +49,7 @@ public: // Result properties /// The knocked room ID. - QString roomId() const - { - return loadFromJson<QString>("room_id"_ls); - } + QString roomId() const { return loadFromJson<QString>("room_id"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/list_public_rooms.h b/lib/csapi/list_public_rooms.h index 1c73c0af..963c8b56 100644 --- a/lib/csapi/list_public_rooms.h +++ b/lib/csapi/list_public_rooms.h @@ -111,18 +111,12 @@ public: /// A pagination token for the response. The absence of this token /// means there are no more results to fetch and the client should /// stop paginating. - QString nextBatch() const - { - return loadFromJson<QString>("next_batch"_ls); - } + QString nextBatch() const { return loadFromJson<QString>("next_batch"_ls); } /// A pagination token that allows fetching previous results. The /// absence of this token means there are no results before this /// batch, i.e. this is the first batch. - QString prevBatch() const - { - return loadFromJson<QString>("prev_batch"_ls); - } + QString prevBatch() const { return loadFromJson<QString>("prev_batch"_ls); } /// An estimate on the total number of public rooms, if the /// server has an estimate. @@ -196,18 +190,12 @@ public: /// A pagination token for the response. The absence of this token /// means there are no more results to fetch and the client should /// stop paginating. - QString nextBatch() const - { - return loadFromJson<QString>("next_batch"_ls); - } + QString nextBatch() const { return loadFromJson<QString>("next_batch"_ls); } /// A pagination token that allows fetching previous results. The /// absence of this token means there are no results before this /// batch, i.e. this is the first batch. - QString prevBatch() const - { - return loadFromJson<QString>("prev_batch"_ls); - } + QString prevBatch() const { return loadFromJson<QString>("prev_batch"_ls); } /// An estimate on the total number of public rooms, if the /// server has an estimate. diff --git a/lib/csapi/login.h b/lib/csapi/login.h index ce783af2..b35db1eb 100644 --- a/lib/csapi/login.h +++ b/lib/csapi/login.h @@ -121,10 +121,7 @@ public: // Result properties /// The fully-qualified Matrix ID for the account. - QString userId() const - { - return loadFromJson<QString>("user_id"_ls); - } + QString userId() const { return loadFromJson<QString>("user_id"_ls); } /// An access token for the account. /// This access token can then be used to authorize other requests. @@ -146,10 +143,7 @@ public: /// ID of the logged-in device. Will be the same as the /// corresponding parameter in the request, if one was specified. - QString deviceId() const - { - return loadFromJson<QString>("device_id"_ls); - } + QString deviceId() const { return loadFromJson<QString>("device_id"_ls); } /// Optional client configuration provided by the server. If present, /// clients SHOULD use the provided object to reconfigure themselves, diff --git a/lib/csapi/message_pagination.h b/lib/csapi/message_pagination.h index 020ef543..363e4d99 100644 --- a/lib/csapi/message_pagination.h +++ b/lib/csapi/message_pagination.h @@ -66,26 +66,17 @@ public: /// The token the pagination starts from. If `dir=b` this will be /// the token supplied in `from`. - QString begin() const - { - return loadFromJson<QString>("start"_ls); - } + QString begin() const { return loadFromJson<QString>("start"_ls); } /// The token the pagination ends at. If `dir=b` this token should /// be used again to request even earlier events. - QString end() const - { - return loadFromJson<QString>("end"_ls); - } + QString end() const { return loadFromJson<QString>("end"_ls); } /// A list of room events. The order depends on the `dir` parameter. /// For `dir=b` events will be in reverse-chronological order, /// for `dir=f` in chronological order, so that events start /// at the `from` point. - RoomEvents chunk() - { - return takeFromJson<RoomEvents>("chunk"_ls); - } + RoomEvents chunk() { return takeFromJson<RoomEvents>("chunk"_ls); } /// A list of state events relevant to showing the `chunk`. For example, if /// `lazy_load_members` is enabled in the filter then this may contain @@ -95,10 +86,7 @@ public: /// may remove membership events which would have already been /// sent to the client in prior calls to this endpoint, assuming /// the membership of those members has not changed. - StateEvents state() - { - return takeFromJson<StateEvents>("state"_ls); - } + StateEvents state() { return takeFromJson<StateEvents>("state"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/notifications.h b/lib/csapi/notifications.h index 0cc165ce..0c38fe6b 100644 --- a/lib/csapi/notifications.h +++ b/lib/csapi/notifications.h @@ -71,10 +71,7 @@ public: /// The token to supply in the `from` param of the next /// `/notifications` request in order to request more /// events. If this is absent, there are no more results. - QString nextToken() const - { - return loadFromJson<QString>("next_token"_ls); - } + QString nextToken() const { return loadFromJson<QString>("next_token"_ls); } /// The list of events that triggered notifications. std::vector<Notification> notifications() diff --git a/lib/csapi/openid.h b/lib/csapi/openid.h index 88218c20..0be39c8c 100644 --- a/lib/csapi/openid.h +++ b/lib/csapi/openid.h @@ -43,10 +43,7 @@ public: /// Specification](http://openid.net/specs/openid-connect-core-1_0.html#TokenResponse) /// with the only difference being the lack of an `id_token`. Instead, /// the Matrix homeserver's name is provided. - OpenidToken tokenData() const - { - return fromJson<OpenidToken>(jsonData()); - } + OpenidToken tokenData() const { return fromJson<OpenidToken>(jsonData()); } }; } // namespace Quotient diff --git a/lib/csapi/peeking_events.h b/lib/csapi/peeking_events.h index 1eee880f..885ff340 100644 --- a/lib/csapi/peeking_events.h +++ b/lib/csapi/peeking_events.h @@ -53,23 +53,14 @@ public: /// A token which correlates to the first value in `chunk`. This /// is usually the same token supplied to `from=`. - QString begin() const - { - return loadFromJson<QString>("start"_ls); - } + QString begin() const { return loadFromJson<QString>("start"_ls); } /// A token which correlates to the last value in `chunk`. This /// token should be used in the next request to `/events`. - QString end() const - { - return loadFromJson<QString>("end"_ls); - } + QString end() const { return loadFromJson<QString>("end"_ls); } /// An array of events. - RoomEvents chunk() - { - return takeFromJson<RoomEvents>("chunk"_ls); - } + RoomEvents chunk() { return takeFromJson<RoomEvents>("chunk"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/presence.h b/lib/csapi/presence.h index c817ad9f..4ab50e25 100644 --- a/lib/csapi/presence.h +++ b/lib/csapi/presence.h @@ -55,10 +55,7 @@ public: // Result properties /// This user's presence. - QString presence() const - { - return loadFromJson<QString>("presence"_ls); - } + QString presence() const { return loadFromJson<QString>("presence"_ls); } /// The length of time in milliseconds since an action was performed /// by this user. @@ -68,10 +65,7 @@ public: } /// The state message for this user if one was set. - QString statusMsg() const - { - return loadFromJson<QString>("status_msg"_ls); - } + QString statusMsg() const { return loadFromJson<QString>("status_msg"_ls); } /// Whether the user is currently active Omittable<bool> currentlyActive() const diff --git a/lib/csapi/profile.h b/lib/csapi/profile.h index 3cda34f8..8bbe4f8c 100644 --- a/lib/csapi/profile.h +++ b/lib/csapi/profile.h @@ -101,10 +101,7 @@ public: // Result properties /// The user's avatar URL if they have set one, otherwise not present. - QString avatarUrl() const - { - return loadFromJson<QString>("avatar_url"_ls); - } + QString avatarUrl() const { return loadFromJson<QString>("avatar_url"_ls); } }; /*! \brief Get this user's profile information. @@ -133,10 +130,7 @@ public: // Result properties /// The user's avatar URL if they have set one, otherwise not present. - QString avatarUrl() const - { - return loadFromJson<QString>("avatar_url"_ls); - } + QString avatarUrl() const { return loadFromJson<QString>("avatar_url"_ls); } /// The user's display name if they have set one, otherwise not present. QString displayname() const diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index 90d2ce79..a5eb48f0 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -72,10 +72,7 @@ public: /// The specific push rule. This will also include keys specific to the /// rule itself such as the rule's `actions` and `conditions` if set. - PushRule pushRule() const - { - return fromJson<PushRule>(jsonData()); - } + PushRule pushRule() const { return fromJson<PushRule>(jsonData()); } }; /*! \brief Delete a push rule. @@ -191,10 +188,7 @@ public: // Result properties /// Whether the push rule is enabled or not. - bool enabled() const - { - return loadFromJson<bool>("enabled"_ls); - } + bool enabled() const { return loadFromJson<bool>("enabled"_ls); } }; /*! \brief Enable or disable a push rule. diff --git a/lib/csapi/redaction.h b/lib/csapi/redaction.h index f12e6b71..f0db9f9f 100644 --- a/lib/csapi/redaction.h +++ b/lib/csapi/redaction.h @@ -46,10 +46,7 @@ public: // Result properties /// A unique identifier for the event. - QString eventId() const - { - return loadFromJson<QString>("event_id"_ls); - } + QString eventId() const { return loadFromJson<QString>("event_id"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/registration.h b/lib/csapi/registration.h index 0ad8b101..c1614f20 100644 --- a/lib/csapi/registration.h +++ b/lib/csapi/registration.h @@ -108,10 +108,7 @@ public: /// /// Any user ID returned by this API must conform to the grammar given in /// the [Matrix specification](/appendices/#user-identifiers). - QString userId() const - { - return loadFromJson<QString>("user_id"_ls); - } + QString userId() const { return loadFromJson<QString>("user_id"_ls); } /// An access token for the account. /// This access token can then be used to authorize other requests. @@ -135,10 +132,7 @@ public: /// ID of the registered device. Will be the same as the /// corresponding parameter in the request, if one was specified. /// Required if the `inhibit_login` option is false. - QString deviceId() const - { - return loadFromJson<QString>("device_id"_ls); - } + QString deviceId() const { return loadFromJson<QString>("device_id"_ls); } }; /*! \brief Begins the validation process for an email to be used during diff --git a/lib/csapi/room_send.h b/lib/csapi/room_send.h index a9e7ca13..96f5beca 100644 --- a/lib/csapi/room_send.h +++ b/lib/csapi/room_send.h @@ -49,10 +49,7 @@ public: // Result properties /// A unique identifier for the event. - QString eventId() const - { - return loadFromJson<QString>("event_id"_ls); - } + QString eventId() const { return loadFromJson<QString>("event_id"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/room_state.h b/lib/csapi/room_state.h index 99eb4fc9..f95af223 100644 --- a/lib/csapi/room_state.h +++ b/lib/csapi/room_state.h @@ -71,10 +71,7 @@ public: // Result properties /// A unique identifier for the event. - QString eventId() const - { - return loadFromJson<QString>("event_id"_ls); - } + QString eventId() const { return loadFromJson<QString>("event_id"_ls); } }; } // namespace Quotient diff --git a/lib/csapi/rooms.h b/lib/csapi/rooms.h index 179d7a27..51af2c65 100644 --- a/lib/csapi/rooms.h +++ b/lib/csapi/rooms.h @@ -38,11 +38,7 @@ public: // Result properties /// The full event. - EventPtr event() - - { - return fromJson<EventPtr>(jsonData()); - } + EventPtr event() { return fromJson<EventPtr>(jsonData()); } }; /*! \brief Get the state identified by the type and key. @@ -103,11 +99,7 @@ public: // Result properties /// The current state of the room - StateEvents events() - - { - return fromJson<StateEvents>(jsonData()); - } + StateEvents events() { return fromJson<StateEvents>(jsonData()); } }; /*! \brief Get the m.room.member events for the room. diff --git a/lib/csapi/users.h b/lib/csapi/users.h index 772a6365..eab18f6c 100644 --- a/lib/csapi/users.h +++ b/lib/csapi/users.h @@ -66,10 +66,7 @@ public: } /// Indicates if the result list has been truncated by the limit. - bool limited() const - { - return loadFromJson<bool>("limited"_ls); - } + bool limited() const { return loadFromJson<bool>("limited"_ls); } }; template <> diff --git a/lib/csapi/voip.h b/lib/csapi/voip.h index 85ab8b41..087ebbbd 100644 --- a/lib/csapi/voip.h +++ b/lib/csapi/voip.h @@ -28,10 +28,7 @@ public: // Result properties /// The TURN server credentials. - QJsonObject data() const - { - return fromJson<QJsonObject>(jsonData()); - } + QJsonObject data() const { return fromJson<QJsonObject>(jsonData()); } }; } // namespace Quotient diff --git a/lib/csapi/whoami.h b/lib/csapi/whoami.h index 203742c9..319f82c5 100644 --- a/lib/csapi/whoami.h +++ b/lib/csapi/whoami.h @@ -34,19 +34,13 @@ public: // Result properties /// The user ID that owns the access token. - QString userId() const - { - return loadFromJson<QString>("user_id"_ls); - } + QString userId() const { return loadFromJson<QString>("user_id"_ls); } /// Device ID associated with the access token. If no device /// is associated with the access token (such as in the case /// of application services) then this field can be omitted. /// Otherwise this is required. - QString deviceId() const - { - return loadFromJson<QString>("device_id"_ls); - } + QString deviceId() const { return loadFromJson<QString>("device_id"_ls); } }; } // namespace Quotient |