| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Add the 'whoami' api call, as a means to validate an access token
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
| |
Synapse got r0/login in Jan 2016 (pull 459), so lets use it
instead of the ancient api/v1/login.
Fixes: https://github.com/matrix-org/purple-matrix/issues/100
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|\
| |
| | |
E2E support
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Route the count of remaining one time keys out of the sync result.
We need the newer (v2?) API for this.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
| |
| |
| |
| |
| |
| |
| | |
Add api call for uploading device and one time keys.
It expects the json blobs to be presigned.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|/
|
|
|
|
|
|
|
|
|
|
| |
The http_parser handles chunked transfer encoding, but it calls
the body handler for each chunk and it's our job to stitch it all
back together.
Use of on_message_complete suggested by ScottAbbey on github
Fixes #72
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|\
| |
| | |
Handle media messages (m.video, m.audio, m.file)
|
| |
| |
| |
| |
| |
| |
| |
| | |
Handle m.video, m.file, m.audio and m.image in _handle_incoming_media.
Remove _handle incoming_image. On incoming media, always print a chat
message with the download link and mimetype/size. If a thumbnail_url is
available and the thumbnail size is small, download and show that. Otherwise,
only for m_image, ask for a server generated thumbnail.
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
Initial sync's are getting huge, we really need to fix that,
but in the mean time bump the max size up.
I've seen matrix HQ giving out a 5MB reply in the initial sync.
see issue #28.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
| |
* Comment about using state table for ephermal events
* Move JSON handling into matrix-api
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
I made the same mistake in image upload I had in download - an extra /
at the start triggered a 500.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
I had an extra / after the hostname, and it doesn't need the access
key.
(Interestingly my server would take the extra / but matrix.org wouldn't)
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
| |
| |
| |
| | |
so we don't show up once for each login
|
|/
|
|
| |
using the "Group Typing Notifications" plugin
|
|\
| |
| | |
Enable room invites when matrix handle is known
|
| |
| |
| |
| | |
Signed-off-by: Damien Zammit <damien@zamaudio.com>
|
|/
|
|
|
|
|
|
|
|
| |
Allow downloading of a thumbnail for a file.
Note: Synapse really doesn't like it if you don't specify
the height (I get a 500); so the caller has to give some
guess of dimensions, but the server gives something
reasonable.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
| |
Download a file given a URI.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
| |
When a response can't be parsed as JSON pass the body and length
to the callback.
Also add the content_type.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
I added an extra /join in the upload url - synapse
seems to ignore it but we'd better remove it!
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
|
|
| |
In 2f143058d I used the purple_util_fetch_url_request_data_len_with_account
which turns out to be new in libpurple 2.11 and ubuntu is still
stuck on 2.10.
This is a build hack that allows building on 2.10 but doesn't
allow sending images.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
| |
Upload a file to a Matrix server.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
We need to be able to pass a content-type header for
file uploading.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow binary data to be sent after the headers.
This data may include a NUL byte and so everything gets
more complicated.
The data is sent raw on the wire.
It's used for uploading files.
We rename matrix_api_start to matrix_api_start_full with
the extra parameters and provide a matrix_api_start for
the callers who don't need the extra binary data.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
| |
|
| |
|
| |
|
|
|
|
| |
Double-clicking on a room in the buddy list now joins a room if necessary.
|
|
|
|
| |
If a user unticks 'persistent', then closes a tab, we should leave the room.
|
|
|
|
|
| |
We weren't correctly initialising a GError *, which meant that we then
tried to display the error message from an invalid location.
|
|
|
|
|
|
|
|
|
| |
Try to deal better with errors which occur during API requests, in terms of
reporting them to the user/logs, and in terms of not writing to freed
structures.
Also do some sanity-checking of the supplied homeserver URL: make sure it is
https:// or http://, and make sure we get the right number of '/'s.
|
|
|
|
|
| |
When making a request via a proxy, we are supposed to put the absolute URL
in the request-line.
|
|
|
|
|
| |
Libpurple assumes that path+querystring is < 256 characters, so we're going to
have to build our own GET requests as well as POSTs.
|
|
|
|
|
|
| |
This requires the new full_state support from
https://github.com/matrix-org/synapse/pull/332. It's much cleaner than trying
to request the state the first time we hear about a room.
|
|
|
|
|
| |
Now that we persist the next_batch identifier, we no longer get all of the
state for a room, so we need to explicitly fetch it on initial sync.
|
|
|
|
|
| |
Apart from seeming like the expected behaviour, this should stop us ending up
with segfaults when the sync completes after the connection has gone away.
|
|
|
|
|
|
|
| |
Move all matrix-login and bits of matrix-sync into matrix-connection, where
it seems to make more sense.
Also move MatrixConnectionData into matrix-connection.h
|
|
|
|
|
| |
This structure comes and goes with each connection, so rename it to better
reflect its lifecycle.
|
|
|
|
|
|
| |
We're going to need to do proper cancelling of API requests, which means
passing around enough state to make that possible, so return the
MatrixApiRequestData * from matrix_api_*.
|
|
|
|
|
| |
Persist the next_batch, so that we don't get old scrollback each time we open
the application.
|
| |
|
|
|
|
|
|
| |
Implement an event queue, and send messages through it.
We still need to sort out local echo.
|
|
|
|
|
| |
Username, password, and homeserver are now configurable options, and we use the
login api rather than making the user get their own access token.
|
|
|
|
| |
Use an external http parser, instead of inventing that wheel ourselves.
|
|
|
|
|
| |
Factor out the handling of errors from API calls, to make it easier to add new
ones.
|
|
|
|
| |
We now receive new messages in existing chats.
|