The state store creates directory structure but the crypto store does
not.
This can lead to confusing errors where we require a directory to be
created by the library user but it gets created by the library.
EventBuilder now clears itself between `build_sync_response` calls so
that each subsequent call will return an empty response if nothing was
added.
This allows reuse of a single EventBuilder instance which is important
for correct sync token rotation.
The previous test only tested using the `EventEmitter`, which missed the
fact that the client was receiving unhoisted events. The test now also
tests the client state to detect this.
Remove 'get' from get_public_rooms* methods.
Rename RoomSearchBuilder -> RoomListFilterBuilder.
Use u32 over UInt in builders and Into<String> for String.
Fix docs of public room methods and builders.
Also refactor and document why this hoisting is needed.
This change makes the user_presence test fail because the hoisting
exposes an error encoded into the test's expected result.
Previously, the test expected 2 members in the room at the end. This is
incorrect since one of the members in the test data leaves the room.
However, since the prev_content of state events was previously not
hoisted to the top level, the `membership_change` method would not
notice it and thus not realize the member had left the room. The test
was corrected to expect only a single member in the room.
Another test change was made due to a limitation of EventBuilder: due to
the fact that it makes the test data go through a de/ser cycle, it
cannot easily hoist prev_content to the top level. Because of this, the
tests were change to put prev_content into the top level from the
outset.
After discussing with poljar, we concluded we don't actually need to
tracking membership state, since we won't be tracking users that
left (banned, kicked, disinvited).
The only thing we need to keep track of is the difference between joined
and invited users which will be dealt with in a separate commit.