Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
A few places in the library dealt with state events without any notion
of state_key inside events, including StateEvent[Base] and relevant
functions in Room. A number of workarounds have been made; e.g.,
Room::setMemberState() accepted userId as a separate parameter, ignoring
the state key inside the RoomMemberEvent already passed to it, and
Room::setLocalAliases() had a bug in the initial version where the
function still tried to pass aliases in an event with an empty state
key. This commit fixes this shortcoming: StateEventBase now gets
stateKey as one more parameter, Room::Private::getCurrentState()
respects stateKey and returns properly constructed stub events, and
Room::setMemberState() gives way to a more generic Room::setState() that
works uniformly with whatever state event you pass to it.
|
|
|
|
|
|
|
|
|
|
This allows to detect if a room has been encrypted (no room state, just
an event as of yet). Closes #84.
|
|
|
|
|
|
|
|
MemberEventContent::displayName() will strip away Unicode text direction override characters. Direct access to JSON can still provide "raw" data.
|
|
Check the URL before passing over to Connection::downloadFile(), not only the file name.
|
|
Fix Qt<5.7 build for std::hash<StateEventKey>
|
|
away TextContent when not needed
1. The spec says "if you support rich replies you MUST support fallbacks" - this commit only adds dealing with event JSON but not with textual fallbacks.
2. TextContent is only created if there's something on top of plain body (an HTML body or a reply).
|
|
|
|
|
|
|
|
|
|
Closes #234.
|
|
Originally there was an idea to make a common base class for all event content. Aside from really trivial unification of toJson() this doesn't span across various types of events, and since state events use static, rather than dynamic, polymorphism (StateEvent<> is a template with the aggregated content vs. RoomMessageEvent with the aggregated pointer-to-content-base), there's no considerable value in using the base class. If state events start using the same approach as message events, this may be brought back but not until then.
|
|
This has been fixed in the past but got undone after the great remaking of the event types system. Further commits will introduce tests to make sure this does not get undone again.
|
|
This makes unknown state events to still be treated as state events.
|
|
So that is<> could be specialised for some types.
|
|
It's already logged in Room - actually, several times at different
stages.
|
|
resolution
The API version number should have been bumped long ago.
|
|
It's not mandated by the spec for anything except m.file but hey it's
convenient.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetMembersByRoomJob was dysfunctional so far, creating "unknown
RoomMemberEvents" instead of proper ones. Now that we need it for lazy-
loading, it's fixed!
|
|
|
|
Both now use through a common JsonConverter<> template class with its
base definition tuned for structs/QJsonObjects and specialisations for
non-object types. This new implementation doesn't work with virtual
fillJson functions yet (so EventContent classes still use toJson as a
member function) and does not cope quite well with non-constructible
objects (you have to specialise JsonConverter<> rather than, more
intuitively, JsonObjectConverter<>), but overall is more streamlined
compared to the previous implementation. It also fixes one important
issue that pushed for a rewrite: the previous implementation was not
working with structure hierarchies at all so (in particular) the Filter
part of CS API was totally disfunctional.
|
|
Keeping them protected extends API surface with no reasonable use from it (and for now derived classes don't access StateEvent<> data members directly, anyway).
|
|
Don't make JSON for event content only to parse it again; drop extraneous constructs.
|
|
|
|
Brings event id of the state event that was in effect before this one arrived. This key is not specced but it's used in the wild since forever.
|
|
Also: use Matrix type instead of internal type id in StateEventKey
(Because internal type id maps to the library type system which will not
discern between Unknown events and therefore will mix together events of
different types in Room::Private::baseState/currentState. The Room code
is updated accordingly (bonus: more asserts there).)
Closes #255.
|
|
...that creates an "empty" event, i.e. an event with content initialised by a default constructor (not all content types support this but those for simple events do).
|
|
- registerEventType(): comment the cryptic _ variable
- Room::postEvent: document the return value
- Room::Private: upgrade comments to doc-comments - even though in Private, they still are helpful to show hints in IDEs.
- General cleanup
|
|
|
|
|
|
|
|
|
|
|