aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/definitions')
-rw-r--r--lib/csapi/definitions/client_device.h9
-rw-r--r--lib/csapi/definitions/device_keys.h14
-rw-r--r--lib/csapi/definitions/event_filter.h5
-rw-r--r--lib/csapi/definitions/push_condition.h10
-rw-r--r--lib/csapi/definitions/push_rule.h9
-rw-r--r--lib/csapi/definitions/room_event_filter.h3
-rw-r--r--lib/csapi/definitions/sync_filter.h13
7 files changed, 63 insertions, 0 deletions
diff --git a/lib/csapi/definitions/client_device.h b/lib/csapi/definitions/client_device.h
index 4c09e13c..4ed46a52 100644
--- a/lib/csapi/definitions/client_device.h
+++ b/lib/csapi/definitions/client_device.h
@@ -13,11 +13,20 @@ namespace QMatrixClient
{
// Data structures
+ /// A client device
struct Device
{
+ /// Identifier of this device.
QString deviceId;
+ /// Display name set by the user for this device. Absent if no name has been
+ /// set.
QString displayName;
+ /// The IP address where this device was last seen. (May be a few minutes out
+ /// of date, for efficiency reasons).
QString lastSeenIp;
+ /// The timestamp (in milliseconds since the unix epoch) when this devices
+ /// was last seen. (May be a few minutes out of date, for efficiency
+ /// reasons).
Omittable<qint64> lastSeenTs;
};
diff --git a/lib/csapi/definitions/device_keys.h b/lib/csapi/definitions/device_keys.h
index 895700c1..d74c9259 100644
--- a/lib/csapi/definitions/device_keys.h
+++ b/lib/csapi/definitions/device_keys.h
@@ -13,12 +13,26 @@ namespace QMatrixClient
{
// Data structures
+ /// Device identity keys
struct DeviceKeys
{
+ /// The ID of the user the device belongs to. Must match the user ID used
+ /// when logging in.
QString userId;
+ /// The ID of the device these keys belong to. Must match the device ID used
+ /// when logging in.
QString deviceId;
+ /// The encryption algorithms supported by this device.
QStringList algorithms;
+ /// Public identity keys. The names of the properties should be in the
+ /// format ``<algorithm>:<device_id>``. The keys themselves should be
+ /// encoded as specified by the key algorithm.
QHash<QString, QString> keys;
+ /// Signatures for the device key object. A map from user ID, to a map from
+ /// ``<algorithm>:<device_id>`` to the signature.
+ ///
+ /// The signature is calculated using the process described at `Signing
+ /// JSON`_.
QHash<QString, QHash<QString, QString>> signatures;
};
diff --git a/lib/csapi/definitions/event_filter.h b/lib/csapi/definitions/event_filter.h
index 407ef7c5..4f5b00f9 100644
--- a/lib/csapi/definitions/event_filter.h
+++ b/lib/csapi/definitions/event_filter.h
@@ -15,10 +15,15 @@ namespace QMatrixClient
struct Filter
{
+ /// The maximum number of events to return.
Omittable<int> limit;
+ /// A list of sender IDs to exclude. If this list is absent then no senders are excluded. A matching sender will be excluded even if it is listed in the ``'senders'`` filter.
QStringList notSenders;
+ /// A list of event types to exclude. If this list is absent then no event types are excluded. A matching type will be excluded even if it is listed in the ``'types'`` filter. A '*' can be used as a wildcard to match any sequence of characters.
QStringList notTypes;
+ /// A list of senders IDs to include. If this list is absent then all senders are included.
QStringList senders;
+ /// A list of event types to include. If this list is absent then all event types are included. A ``'*'`` can be used as a wildcard to match any sequence of characters.
QStringList types;
};
diff --git a/lib/csapi/definitions/push_condition.h b/lib/csapi/definitions/push_condition.h
index 5744b9b8..83f63183 100644
--- a/lib/csapi/definitions/push_condition.h
+++ b/lib/csapi/definitions/push_condition.h
@@ -15,8 +15,18 @@ namespace QMatrixClient
struct PushCondition
{
QString kind;
+ /// Required for ``event_match`` conditions. The dot-separated field of the
+ /// event to match.
QString key;
+ /// Required for ``event_match`` conditions. The glob-style pattern to
+ /// match against. Patterns with no special glob characters should be
+ /// treated as having asterisks prepended and appended when testing the
+ /// condition.
QString pattern;
+ /// Required for ``room_member_count`` conditions. A decimal integer
+ /// optionally prefixed by one of, ==, <, >, >= or <=. A prefix of < matches
+ /// rooms where the member count is strictly less than the given number and
+ /// so forth. If no prefix is present, this parameter defaults to ==.
QString is;
};
diff --git a/lib/csapi/definitions/push_rule.h b/lib/csapi/definitions/push_rule.h
index 74ecf79c..d7f93e41 100644
--- a/lib/csapi/definitions/push_rule.h
+++ b/lib/csapi/definitions/push_rule.h
@@ -19,11 +19,20 @@ namespace QMatrixClient
struct PushRule
{
+ /// The actions to perform when this rule is matched.
QVector<QVariant> actions;
+ /// Whether this is a default rule, or has been set explicitly.
bool isDefault;
+ /// Whether the push rule is enabled or not.
bool enabled;
+ /// The ID of this rule.
QString ruleId;
+ /// The conditions that must hold true for an event in order for a rule to be
+ /// applied to an event. A rule with no conditions always matches. Only
+ /// applicable to ``underride`` and ``override`` rules.
QVector<PushCondition> conditions;
+ /// The glob-style pattern to match against. Only applicable to ``content``
+ /// rules.
QString pattern;
};
diff --git a/lib/csapi/definitions/room_event_filter.h b/lib/csapi/definitions/room_event_filter.h
index b503ec3a..38b3e50f 100644
--- a/lib/csapi/definitions/room_event_filter.h
+++ b/lib/csapi/definitions/room_event_filter.h
@@ -16,8 +16,11 @@ namespace QMatrixClient
struct RoomEventFilter : Filter
{
+ /// A list of room IDs to exclude. If this list is absent then no rooms are excluded. A matching room will be excluded even if it is listed in the ``'rooms'`` filter.
QStringList notRooms;
+ /// A list of room IDs to include. If this list is absent then all rooms are included.
QStringList rooms;
+ /// If ``true``, includes only events with a url key in their content. If ``false``, excludes those events.
bool containsUrl;
};
diff --git a/lib/csapi/definitions/sync_filter.h b/lib/csapi/definitions/sync_filter.h
index f7428c0d..c4393596 100644
--- a/lib/csapi/definitions/sync_filter.h
+++ b/lib/csapi/definitions/sync_filter.h
@@ -15,14 +15,22 @@ namespace QMatrixClient
{
// Data structures
+ /// Filters to be applied to room data.
struct RoomFilter
{
+ /// A list of room IDs to exclude. If this list is absent then no rooms are excluded. A matching room will be excluded even if it is listed in the ``'rooms'`` filter. This filter is applied before the filters in ``ephemeral``, ``state``, ``timeline`` or ``account_data``
QStringList notRooms;
+ /// A list of room IDs to include. If this list is absent then all rooms are included. This filter is applied before the filters in ``ephemeral``, ``state``, ``timeline`` or ``account_data``
QStringList rooms;
+ /// The events that aren't recorded in the room history, e.g. typing and receipts, to include for rooms.
Omittable<RoomEventFilter> ephemeral;
+ /// Include rooms that the user has left in the sync, default false
bool includeLeave;
+ /// The state events to include for rooms.
Omittable<RoomEventFilter> state;
+ /// The message and state update events to include for rooms.
Omittable<RoomEventFilter> timeline;
+ /// The per user account data to include for rooms.
Omittable<RoomEventFilter> accountData;
};
@@ -35,10 +43,15 @@ namespace QMatrixClient
struct SyncFilter
{
+ /// List of event fields to include. If this list is absent then all fields are included. The entries may include '.' charaters to indicate sub-fields. So ['content.body'] will include the 'body' field of the 'content' object. A literal '.' character in a field name may be escaped using a '\\'. A server may include more fields than were requested.
QStringList eventFields;
+ /// The format to use for events. 'client' will return the events in a format suitable for clients. 'federation' will return the raw event as receieved over federation. The default is 'client'.
QString eventFormat;
+ /// The presence updates to include.
Omittable<Filter> presence;
+ /// The user account data that isn't associated with rooms to include.
Omittable<Filter> accountData;
+ /// Filters to be applied to room data.
Omittable<RoomFilter> room;
};