aboutsummaryrefslogtreecommitdiffstats
path: root/matrix-connection.c
Commit message (Collapse)AuthorAgeFilesLines
* matrix-connection: Only change state and progress if we're not already ↵Ave2021-02-051-2/+5
| | | | connected (#111)
* connection: Use stored access tokenDr. David Alan Gilbert2019-12-281-1/+53
| | | | | | | If we've got a stored access token, try that (by testing with a 'whoami' call) and if it fails fall back to passworded login. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* connection: Handle no password explicitlyDr. David Alan Gilbert2019-12-281-4/+75
| | | | | | | | | | | By default purple asks for a password if there's none stored, but when we use an access token we'll want to have no password prompt at all. To do this we flag OPT_PROTO_PASSWORD_OPTIONAL and then have to handle the case with no password manually. Mostly cribbed from jabber/auth_cyrus.c Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* connection: Split start of sync out of _login_completedDr. David Alan Gilbert2019-12-281-26/+35
| | | | | | | | | | _login_completed currently fills in the account data from the login transaction and then kicks off the initial sync. Split the code to do the initial sync out; we're going to need to use it in a different case later on. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* connection: store access tokenDr. David Alan Gilbert2019-12-281-0/+2
| | | | | | Store the access token we get after login. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* e2e: Retrieve or create Olm account state, send keysDr. David Alan Gilbert2018-02-251-2/+8
| | | | | | | | If we've got a previously stored olm account state then use it, else create us a new one. Either way, upload the device keys to the server. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* Re-use the device-id provided by the serverEion Robb2017-03-121-1/+5
| | | | so we don't show up once for each login
* Pass body/len/content_type to completion callbackDr. David Alan Gilbert2016-11-131-3/+6
| | | | | | | | 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>
* Invert the sense of the 'full_state' flagRichard van der Hoff2015-11-031-3/+3
| | | | | Inverting it allows us to include a warning that it needs a bleeding-edge synapse.
* Reload old messages on first connectionRichard van der Hoff2015-11-021-1/+11
| | | | | The Pidgin UI is crappy for finding old messages, so reload them from the server on startup.
* Handle incoming room invitesRichard van der Hoff2015-11-021-0/+9
| | | | | Propagate received invites to the UI, and correctly handle accepting/refusing them.
* Implement joining roomsRichard van der Hoff2015-10-301-0/+68
| | | | Double-clicking on a room in the buddy list now joins a room if necessary.
* Fix segfault on homeserver connection dropRichard van der Hoff2015-10-301-2/+10
| | | | | | | If the connection dropped in the middle of us receiving a sync response, we tried to set the next_batch setting on the account to an invalid string (because we failed to initialise the pointer). Fix the segfault that caused, and clean up some of the other error handling in the area at the same time.
* Improve error-handling in API requestsRichard van der Hoff2015-10-291-2/+7
| | | | | | | | | 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.
* Request a full_state sync the first time we connect to an account.Richard van der Hoff2015-10-271-11/+37
| | | | | | 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.
* Better room names for one-to-one chatsRichard van der Hoff2015-10-261-0/+5
| | | | Give rooms a name according to who's in it, if there is no proper name.
* Update the room state on first messageRichard van der Hoff2015-10-221-0/+5
| | | | | 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.
* Abort active sync when the account disconnectsRichard van der Hoff2015-10-221-2/+34
| | | | | 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.
* Refactor the connection codeRichard van der Hoff2015-10-221-0/+145
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