Commit graph

34 commits

Author SHA1 Message Date
Daniel García Moreno
49c51bcd29 Direct attr in room struct to know if it's direct 2018-02-01 19:26:20 +01:00
Daniel García Moreno
2e56093497 Backend: Fill the gap in room messages after sync
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.
2018-01-24 22:05:01 +01:00
Daniel García Moreno
831b11cea2 Sync timeout to 30 secs, 30000s is a lot of time 2018-01-19 19:04:11 +01:00
Daniel García Moreno
6472b1f486 Invite dialog working
With this patch you'll be able to invite other users to one room
2018-01-19 12:16:38 +01:00
Daniel García Moreno
d7b877c999 Accept and reject invitation working 2018-01-17 19:16:53 +01:00
Daniel García Moreno
45a37dda55 Show invitation rooms in sidebar
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.
2018-01-17 14:07:52 +01:00
Daniel García Moreno
ddd9bdebc2 Custom timeout in sync
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.
2018-01-17 13:32:25 +01:00
Daniel García Moreno
477324de74 Long polling instead of sync loop 2018-01-17 13:29:52 +01:00
Daniel García Moreno
2ca943db89 Load more messages recursive to avoid zero messages
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.
2018-01-17 13:16:29 +01:00
Daniel García Moreno
5d43aefae4 New room and left room events management 2018-01-16 11:06:43 +01:00
Daniel García Moreno
cd4e4e58a9 Highlight notifications in blue in room sidebar
See #34
2018-01-13 10:49:45 +01:00
Daniel García Moreno
2001bdc66a Add to fav backend feature
See #34
2018-01-11 14:18:58 +01:00
Daniel García Moreno
01106ac77d Initial drag and drop for favorites room
See #34
2018-01-11 13:51:39 +01:00
Daniel García Moreno
c443f1fbe6 Show fav and normal rooms in different groups
See #34
2018-01-11 10:33:54 +01:00
Daniel García Moreno
3268c280a1 api: Better room name resoltuion
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.
2018-01-10 16:35:00 +01:00
Daniel García Moreno
5f62377d3b 40 seconds timeout for requests 2018-01-09 18:34:54 +01:00
Daniel García Moreno
a05cbb1533 Global AppOp to avoid gtk loops
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.
2018-01-08 10:18:30 +01:00
Daniel García Moreno
768bc2ad54 Dependency upgrade 2018-01-03 19:20:39 +01:00
Daniel García Moreno
bff4277e7f Move internal commands to a new loop
This patch removes the use of the backend loop for interface events.
2017-12-27 10:42:10 +01:00
Daniel García Moreno
fbbd6a6e5c Maximun number of threads to get user info 2017-12-24 18:59:31 +01:00
Daniel García Moreno
7b6c48327a Room list order by last message
See #34
2017-12-24 16:49:45 +01:00
Daniel García Moreno
8d42e3e928 Room select signal connected
See #34
2017-12-22 20:29:47 +01:00
Daniel García Moreno
31aedceb12 Drawing circle images with custom widget 2017-12-22 19:02:00 +01:00
Daniel García Moreno
d15b80b4d1 Initial version of sidebar room list widgets
See #34
2017-12-21 22:01:30 +01:00
Daniel García Moreno
706e5160bf Fix identicon with unicode chars 2017-12-11 10:04:12 +01:00
Daniel García Moreno
34883301f2 Add a semaphore to limit the number of threads downloading avatars 2017-12-11 09:43:04 +01:00
Daniel García Moreno
b3cbdd4d99 Circle room image
See #20
2017-12-11 08:58:18 +01:00
Daniel García Moreno
4af74a30b6 Member list with avatar and alias
See #18
2017-12-09 17:50:37 +01:00
Daniel García Moreno
b9bbc20ade Members from state in the first sync
Members come in the first sync for all rooms, so we can store it and use
later instead of call get_room_members.
2017-12-09 13:12:20 +01:00
Daniel García Moreno
93cceede17 Login by email working
Close #31
2017-12-08 10:52:17 +01:00
Daniel García Moreno
d38e966ff8 Split the backend into several modules
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
2017-12-08 10:17:46 +01:00
Daniel García Moreno
067d1a403b Different util and global module for gtk and api 2017-12-06 20:24:24 +01:00
Daniel García Moreno
52b60d1993 Move the backend code to fractal-api 2017-12-06 19:21:48 +01:00
Jordan Petridis
63ba9c441c
Re-structure the repo into a cargo workspace instead. 2017-12-06 03:12:08 +02:00