Commit graph

155 commits

Author SHA1 Message Date
Daniel García Moreno
1dbb81e1fe Ignore self typing notifications 2019-07-02 06:06:09 +00:00
Daniel García Moreno
0e55e01e40 Send typing notifications 2019-07-02 06:06:09 +00:00
Christopher Davis
38628c4311 Update gtk-rs stack
Closes https://gitlab.gnome.org/GNOME/fractal/issues/489
2019-06-12 11:59:57 -07:00
Alexandre Franke
98d8a82e7d api: don’t unwrap blindly for left rooms
The Option can be None in some cases.
2019-06-10 14:13:16 +00:00
Alexandre Franke
93bb860559 api: pass ms for sync timeout param 2019-06-05 19:32:09 +02:00
Isaac Curtis
250376a7bd Initial support for being kicked
Remove translatable from kicked dialog
2019-05-28 21:30:15 -06:00
Christopher Davis
2018a70c75 api: Properly parse invite events
Events are wrapped in a content block like so:

```
"content" : {
    "membership" : "invite"
}
```

However we were parsing it as just `"membership" : "invite"`.
Now we properly expect it to be within a content block.

Fixes https://gitlab.gnome.org/GNOME/fractal/issues/456
2019-05-01 20:29:19 +00:00
Christopher Davis
17aca31844 api: Fix publicRooms request
Previously we passed a String as "filter" in our
PublicRoomsRequest, but we needed to be passing
a Filter object. Somewhere along the way the String
stopped being accepted, breaking search.

Fixes https://gitlab.gnome.org/GNOME/fractal/issues/451
2019-05-01 18:04:49 +00:00
Scott Sweeny
1224e8e86f Only set Content-Length header on POSTs 2019-04-29 14:31:02 +00:00
Scott Sweeny
0748badf1a Add Content-Length: 0 header to JSON queries if the length is in fact zero
When using lighttpd as a reverse proxy empty POSTs get rejected by the
server if they don't have Content-Length set to zero, so some calls like
marking a room as read fail to make it to the homeserver.

fixes: GNOME/fractal#475
2019-04-29 14:31:02 +00:00
Christopher Davis
c76a8b17f3 build: Don't use globbing to find sources
Previously we were using a script to grab our sources
automatically. However, this was error-prone and meson
didn't actually understand the output.

Now we declare our sources manually. This helps meson
know when to trigger a build based on what files have
changed.
2019-04-27 16:24:08 +00:00
Christopher Davis
2a659b3962 api: Create types for well-known request
Instead of asking for the identity server and homeserver
url for login, we can ask the users to give us a domain
and make a request to .well-known/matrix/client. This
will give us the identity server and the true url for
the homeserver.

See https://matrix.org/docs/spec/client_server/latest#well-known-uri for details
2019-04-15 10:30:58 -04:00
Alexandre Franke
7eec414e3c rust: fix some warnings 2019-04-14 18:07:26 +02:00
Christopher Davis
8c97771dab fractal-matrix-api: Add workaround for synapse bug 4898
Synapse has a bug that can cause 'ts' for read receipts
to be malformed: https://github.com/matrix-org/synapse/issues/4898

This sets a workaround by replacing the malformed timestamp
to be replaced with 0.

Closes https://gitlab.gnome.org/GNOME/fractal/issues/472
2019-04-08 07:36:58 +00:00
Christopher Davis
2f4e1ecba6 fractal-matrix-api: set history visibility for direct chats
We didn't specify the visibility for participants in direct chats. The default behavior when unspecified is confusing,
and leads to messages sent between the sending of an invite
and the acceptance of it being dropped.

Now we append a state event to our room creation that
sets the room visibility to "invited", meaning users
can see messages from when they were invited.

Closes https://gitlab.gnome.org/GNOME/fractal/issues/327
2019-04-08 07:06:38 +00:00
Xiang Fan
f9fb4455c7 backend: Initial support for session proxy
This patch adds support for using the current session's HTTP and HTTPS
proxy from gio's ProxyResolver. For each type of proxy, it only uses the
first url because reqwest only supports that. We reuse the client
connection pool until it detects any proxy change.
2019-04-03 06:55:20 +00:00
Rasmus Rendal
48c8013be4 Add typing notifications
Add handler for incoming typing notifications in the sync loop
Add an appop handler for typing notifications to the frontend

Feature added for #305
2019-03-07 08:40:03 +00:00
mairandomness
9eb315a816 delete temporary thumbnail file 2019-02-24 07:58:57 -05:00
mairandomness
d71da4afec change thumb path to random file name in temp 2019-02-24 07:58:57 -05:00
mairandomness
a384c19472 create upload_thumbnail
change get_image_media_info to include thumbnail

propagate need for backend

try to debug the code

remove a println I forgot

Progress on using channel for thumb uploads

move thumbnail code to the backend

fix mimetype on json and only call ge_image_media_info on image files

remove random 'e' from util.rs

move get_image_media_info back to the frontend

create Info struct

hehe

lol
2019-02-24 07:58:57 -05:00
Julian Sparber
29a87501af backend: use gloable timeout for http request 2019-02-18 08:55:22 +00:00
Julian Sparber
dd9a14ddce backend: create only one reqwest client 2019-02-18 08:55:22 +00:00
Alejandro Domínguez
2d8e9764e3 API: use global variable for device name 2019-02-15 13:19:52 +00:00
Alejandro Domínguez
dc924b1be0 API: Implement and use user request and response types 2019-02-15 13:19:52 +00:00
Alejandro Domínguez
1ce06f4245 API: rework authentication in register model 2019-02-15 13:19:52 +00:00
Christopher Davis
1239698960 dependencies: Remove tree_magic from fractal-matrix-api
tree_magic was also used to get the mime type of uploads. We
can instead use gio::content_type_guess(). We can use it here because we are handling bytes, which is what it requires.
2019-02-14 16:51:34 -05:00
Julian Sparber
9cdf4760cd room: download full list of members for each room 2019-02-01 08:46:03 +00:00
Julian Sparber
c40553c9d3 avatar: download, cache and remove room avatar 2019-02-01 08:46:03 +00:00
Julian Sparber
9b1756575b backend: clean up room avatar request
We used to request the complete room state to get only the memebers list
if there was no avatar, which was expensive and we actually have already
the members list.
This reduces memory use.
2019-02-01 08:46:03 +00:00
Alejandro Domínguez
e1455bb5fb Readability improvements to model/room.rs 2019-01-26 05:22:38 +01:00
Alejandro Domínguez
dcf51f2ef7 Backend: Implement and use filter API 2019-01-24 23:26:13 +01:00
Alejandro Domínguez
3194c13f1d Backend: Implement and use sync response types and cleanup
We implemented the structs to which we parse the sync response except
the events, which are a tough case for another commit. Some enhancements
and cleanups were made to the code surrounding the sync management in
order to be able to remove unnecessary error handling and/or queries.
2019-01-24 23:26:13 +01:00
Alejandro Domínguez
46ac06576f Backend: enhancements to backend/sync.rs
Removed a mut variable, replaced a match with an if let and used time::Duration
for storing time instead of plain integers.
2019-01-24 15:08:10 +01:00
Alejandro Domínguez
ede3e4b454 Backend: Implement and use register request and response types 2019-01-24 04:08:15 +01:00
Alejandro Domínguez
e24ef247c7 Backend: Implement and use login request and response types 2019-01-24 04:08:15 +01:00
Alejandro Domínguez
b6bde7e99c Backend: implement PublicRoomsRequest
Previously we built the JSON request for listing the rooms directly. Here we do the same
by constructing a struct and then serializing it.
2019-01-22 20:57:06 +01:00
Alejandro Domínguez
9f1af03b08 Backend: use Deserialize in room_search
We replace our own deserializing logic in `room_search()` in `backend/directory.rs`
with the derived Deserialize trait on the room types.
2019-01-22 20:55:21 +01:00
Alejandro Domínguez
32ff088156 Add types related to room listing API 2019-01-22 20:52:20 +01:00
Alejandro Domínguez
ce6582d623 Backend: implement Deserialize for protocol types 2019-01-22 20:21:52 +01:00
Alejandro Domínguez
58c86df864 Add types related to third party protocol module API 2019-01-22 20:19:24 +01:00
Julian Sparber
6f643c12c7 backend: add a RoomMembership to Room type
This replaces some boolean properties of the Room Model with a single
property called membership. This makes the room membership (joined, left,
invited) and tag (favourties, low priority, etc) mutch more
understandable and gives the Model a better structure.
2019-01-22 17:24:32 +01:00
Julian Sparber
9b6f53786f backend: force id on every Message
Since every message has to have a ID, this drops the Option for id in
the Message Model
2019-01-20 18:15:47 +00:00
Julian Sparber
2c30cdfd30 backend: simplify get_alias method of Member 2019-01-15 15:02:05 +00:00
Alejandro Domínguez
9e98846c73 Use stable API endpoints 2019-01-13 13:44:03 +01:00
Alejandro Domínguez
a78e678f32 Return Url directly when a Err() isn't possible
Some functions never return Err, so to make it more clear and use simpler types
we changed them to return just the plain type.
2019-01-13 11:21:54 +00:00
Alejandro Domínguez
63b83d5e0e Backend: Use Url type in BackendData.scalar_url 2019-01-13 11:21:54 +00:00
Alejandro Domínguez
09f504471c Backend: Use Url type in BackendData.server_url 2019-01-13 11:21:54 +00:00
Alejandro Domínguez
48ffd7bd6e Backend: Use slices instead of references to immutable vectors where possible 2019-01-12 16:06:57 +00:00
Alejandro Domínguez
e3fba68591 Backend: Stop depending on cairo for cache_dir_path() and use directories instead 2019-01-09 21:45:20 +00:00
Alejandro Domínguez
a87d712fe4 Backend: Cairo is unused, don't depend on it 2019-01-09 21:45:20 +00:00