Skip to content

Commit

Permalink
GTAD: update to support Matrix 1.11
Browse files Browse the repository at this point in the history
Namely, GTAD itself had to be updated to support patternProperties and
mx-* format names; and gtad.yaml now substitutes `{{% boxes/note %}}`
with a Doxygen \note tag (see also
matrix-org/matrix-spec#1873).
  • Loading branch information
KitsuneRal committed Jun 30, 2024
1 parent ff003a9 commit 3b36719
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
8 changes: 8 additions & 0 deletions Quotient/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,11 @@ constexpr inline size_t mergeStruct(StructT& lhs, const StructT& rhs, const auto
{
return ((... + static_cast<size_t>(merge(lhs.*fields, rhs.*fields))));
}

// These are meant to eventually become separate classes derived from QString (or perhaps
// QByteArray?), with their own construction and validation logic; for now they are just aliases
// for QString to make numerous IDs at least semantically different in the code.

using UserId = QString;
using RoomId = QString;
using EventId = QString;
2 changes: 1 addition & 1 deletion gtad/gtad
Submodule gtad updated 8 files
+59 −33 README.md
+63 −35 analyzer.cpp
+1 −0 analyzer.h
+4 −4 model.cpp
+5 −5 model.h
+15 −10 printer.cpp
+1 −0 printer.h
+2 −3 yaml.h
18 changes: 11 additions & 7 deletions gtad/gtad.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
analyzer:
subst:
"%CLIENT_RELEASE_LABEL%": r0
"%CLIENT_MAJOR_VERSION%": r0
# Escaping open braces because GTAD always treats subst keys as regexes, unlike other places
'\{\{% boxes/note %}}': '\note'
'( +)\{\{% /boxes/note %}}\n': '' # Delete the line with the closing handlebar entirely
identifiers:
signed: signedData
unsigned: unsignedData
Expand Down Expand Up @@ -84,13 +85,16 @@ analyzer:
- dateTime:
type: QDateTime
initializer: QDateTime::fromString("{{defaultValue}}")
- uri:
- uri: &Url
type: QUrl
initializer: QUrl::fromEncoded("{{defaultValue}}")
- mx-mxc-uri: *Url
- mx-user-id: UserId
- mx-room-id: RoomId
- mx-event-id: EventId
- //: &QString
type: QString
initializer: QStringLiteral("{{defaultValue}}")
isString:
- file: *ByteStream
- +set: { avoidCopy: }
+on:
Expand Down Expand Up @@ -122,11 +126,11 @@ analyzer:
- /(room|client)_event.yaml$/: RoomEvents
- /event(_without_room_id)?.yaml$/: Events
- //: "QVector<{{1}}>"
- map: # `additionalProperties` in OpenAPI
- map: # `patternProperties` and `additionalProperties` in OpenAPI
- RoomState:
type: "std::unordered_map<QString, {{1}}>"
type: "std::unordered_map<{{1}}, {{2}}>"
moveOnly:
- /.+/: "QHash<QString, {{1}}>"
- /.+/: "QHash<{{1}}, {{2}}>"
- //: QVariantHash # QJsonObject?..
- variant: # A sequence `type` or a 'oneOf' group in OpenAPI
- /^string,null|null,string$/: *QString
Expand Down

0 comments on commit 3b36719

Please sign in to comment.