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