https://matrix.org/docs/spec/client_server/r0.3.0.html#syncing
The sync give us all new messages after the previous sync, but
sometimes, if there's a lot of time between syncs (after suspend and
resume, or long disconnections) the sync only returns the lasts
messages, and there's a gap that we need to fill.
The invitations are showed in the sidebar now. On click does nothing
right now because we need to implement the accept/reject invitation
dialog and implement the api calls for that.
This should be done because the connection with the matrix server can be
locked after computer disconnect and reconnect, so we should control the
timeout at the client level.
We're ignoring membership events when loading more messages, so if
there's a lot of leave/enter events, we get 0 messages when we try to
load more. This patch retry always gets more messages, because if
there's only no text events, a recursive call is made to find at least
one.
Sometimes a room has the event "m.room.name" but that event doesn't
follows the normal struct:
{
"content": {
"name": "ROOM NAME"
}
}
So we should ignore this events instead of return "WRONG NAME" because
the alias could be valid.
With a global AppOp reference we can launch backend loop and internal
loop in a rust thread so now we can lock until a message comes from the
channel. With this change we don't need to poll the channel.
The APPOP macro runs the AppOp method in the glib main thread, using
this global variable.
See #30
I've split the backend file into several modules, by matrix.org API
funcionality. Now each function receives the backend struct as first
argument and this struct is clonable so we can try to send between
threads. The backend.data is a Arc<Mutex>> so it's shared between calls
and keep the shared information.
* backend/types.rs: enums and structs, BKCommand, BKResponse and Backend
* backend/mod.rs: Backend struct methods, new, run and command_recv
* backend/register.rs: Login related API calls
* backend/user.rs: User related API calls
* backend/media.rs: Media related API calls
* backend/directory.rs: Directory related API calls
* backend/room.rs: Room related API calls
* backend/sync.rs: Sync related API calls