aboutsummaryrefslogtreecommitdiffstats
path: root/matrix-room.c
Commit message (Collapse)AuthorAgeFilesLines
* Responding to PR commentsEion Robb2017-05-281-9/+1
| | | | | * Comment about using state table for ephermal events * Move JSON handling into matrix-api
* Merge branch 'master' into typing-notifications3Eion Robb2017-05-281-4/+30
|\
| * Fix whitespace and a memleakEion Robb2017-05-281-8/+10
| |
| * Support HTML formatting on sending/receiving messagesEion Robb2017-05-231-5/+13
| |
| * Support display of room topicsEion Robb2017-03-121-0/+16
| |
* | Send/receive typing notificationsEion Robb2017-03-121-0/+98
|/ | | | using the "Group Typing Notifications" plugin
* Merge pull request #25 from penguin42/escaping-fixRichard van der Hoff2017-01-031-5/+11
|\ | | | | Escape incoming message bodies
| * Escape incoming message bodiesDr. David Alan Gilbert2017-01-021-5/+11
| | | | | | | | | | | | | | | | | | Purple intereprets incoming message bodies as pseudo HTML, and thus eats <text> - I've not seen it do anything really bad on Pidgin (I can trigger bold but not anything more insecure); not sure other purple frontends. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* | Download thumbnails for images that are too largeDr. David Alan Gilbert2016-12-271-7/+22
|/ | | | | | | | | | | | | | When we decide from the image info that an image is too large, try a thumb instead. Pick 640x480 because a) we need to pick a size and b) That's the right size. c) We should make it configurable. (We could also try this if we didn't have the image info when we get the error). Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* Download imagesDr. David Alan Gilbert2016-11-131-0/+160
| | | | | | | | | | Download images received in events, adding them to Purple's image cache. There are probably improvements that can be made in failure paths and also in trying to use thumbnails. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* Pass body/len/content_type to completion callbackDr. David Alan Gilbert2016-11-131-2/+4
| | | | | | | | 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>
* Unescape the HTML-escaped HTML.Bryce Chidester2016-10-251-3/+9
| | | | | | Matrix uses JSON to pass messages, and the Matrix API functions are perfectly capable of handling the required escaping. HTML needs no escaping. Signed-off-by: Bryce Chidester <bryce@cobryce.com>
* Allow building on libpurple 2.10.xDr. David Alan Gilbert2016-10-161-2/+4
| | | | | | | | | | | 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>
* Send inserted imagesDr. David Alan Gilbert2016-09-031-0/+218
| | | | | | | | | | | | | | | | | | Turn on purple's image facility and cause the messages to be sent. There are two tricky parts to this: a) Purple's idea is a message that can include an image anywhere in it; while Matrix's idea is that you have text events and image events but currently no combo events. My (hacky) solution here is to split purple messages into the text and image components. b) Matrix's images are files that need uploading before the event is sent, and the upload process gives a uri back that must be included in the event. That means we have to somehow delay sending the event until we have the file uploaded. I solve that by using the event hook I added in an earlier commit. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* event hooksDr. David Alan Gilbert2016-09-031-2/+8
| | | | | | | | | | | Some events need to do something else before the event can be transmitted, and indeed the contents of the event aren't necessarily known until that other thing has happened. Add a hook that gets called when the event is ready to be sent and when the event is to be free'd. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* Send outgoing emotesDr. David Alan Gilbert2016-07-101-2/+9
| | | | | | Spot the /me in what we get from pidgin and use m.emote msgtype. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* Handle incoming emotesDr. David Alan Gilbert2016-07-101-2/+15
| | | | | | Spot the event msgtype m.emote and add a /me to what we feed purple. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
* Update for /sync response changesRichard van der Hoff2015-11-191-4/+3
| | | | | https://github.com/matrix-org/matrix-doc/pull/165 changes the format of the /sync response. Update our code to accept it.
* Fix a bug which stopped room name changes being handledRichard van der Hoff2015-11-191-1/+2
| | | | If a room's name changed, we didn't update the UI.
* Fix infinite loop in matrix_room_displayname_to_useridRichard van der Hoff2015-11-031-6/+7
| | | | | Double-clicking a user in the chat window would cause an infinite loop. Because apparently I fail at linked-lists.
* Hopefully fix bugs where the member list got out of syncRichard van der Hoff2015-11-031-57/+228
| | | | | | | | | | We needed better tracking of what we had told purple was each member's displayname. It was terribly confusing having matrix-roommembers try to track it implicitly, which was causing bugs where we were getting out of sync. Instead, let matrix-roommembers hold opaque data for each member, which matrix-room then uses to keep track of the purple displayname. Then move a bunch of the member-update-handling stuff back into matrix-room.
* Include invited members in room name calculationsRichard van der Hoff2015-11-031-1/+1
| | | | We want to include invited members when we are considering names for rooms.
* Implement get_cb_real_nameRichard van der Hoff2015-11-021-0/+9
| | | | | Fixing this means purple is slightly less confused about who the users in our chats are.
* Show correct displayname on our own outgoing messagesRichard van der Hoff2015-11-021-1/+11
| | | | | Make the displayname on our sent messages match that in the member list for the room.
* Handle incoming room invitesRichard van der Hoff2015-11-021-2/+2
| | | | | Propagate received invites to the UI, and correctly handle accepting/refusing them.
* Refactor the statetable out to a separate fileRichard van der Hoff2015-10-301-195/+65
| | | | | Apart from generally being cleaner, we're going to want to use the statetable in isolation of rooms, to handle invites.
* Leave rooms when pidgin tells us to.Richard van der Hoff2015-10-301-7/+35
| | | | If a user unticks 'persistent', then closes a tab, we should leave the room.
* Move the room member table management out to a separate fileRichard van der Hoff2015-10-291-285/+101
| | | | | | | | | Trying to keep the size of matrix-room.c under control, move the membertable management bits out to a separate file. Also do away with the special handling for the first /sync of a room, and instead *always* group together member arrivals/departures until after we've finished handling the state table.
* Set the 'persistent' flag on rooms when added to the buddy listRichard van der Hoff2015-10-291-29/+7
| | | | The 'persistent' behaviour matches the matrix model much better.
* Add an indication of the members of a roomRichard van der Hoff2015-10-271-122/+379
| | | | | | | | An initial implementation for displaying the people in a room. This isn't very nice, and the code is somewhat thrown together as a prototype/proof-of-concept for now. We probably want to refactor matrix-room.c, which is now altogether too unwieldy. It probably also makes sense to try to do some of this stuff on the server.
* Request a full_state sync the first time we connect to an account.Richard van der Hoff2015-10-271-50/+0
| | | | | | 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-13/+137
| | | | 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-1/+52
| | | | | 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.
* Don't send new messages when the connection is droppingRichard van der Hoff2015-10-221-19/+29
|
* Refactor the connection codeRichard van der Hoff2015-10-221-2/+1
| | | | | | | 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
* Rename MatrixAccount to MatrixConnectionDataRichard van der Hoff2015-10-221-7/+8
| | | | | This structure comes and goes with each connection, so rename it to better reflect its lifecycle.
* Implement a 'cancel' method for the matrix-api interfaceRichard van der Hoff2015-10-221-1/+1
| | | | | | 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_*.
* Update README and file commentsRichard van der Hoff2015-10-211-1/+1
|
* Local echoRichard van der Hoff2015-10-211-7/+54
| | | | Do local echo of sent messages, and ignore the remote echo.
* Initial implementation of sending messagesRichard van der Hoff2015-10-211-25/+210
| | | | | | Implement an event queue, and send messages through it. We still need to sort out local echo.
* Fix the memory handling for roomsRichard van der Hoff2015-10-191-22/+50
| | | | Make sure that we delete the room state structures when they are thrown away.
* Refactor a load of codeRichard van der Hoff2015-10-191-176/+128
| | | | Move things around quite a lot, to make it a bit saner
* Implement polling for incoming messagesRichard van der Hoff2015-10-191-12/+164
| | | | We now receive new messages in existing chats.
* Fix some indentationRichard van der Hoff2015-10-191-59/+59
| | | | Eclipse was using tabs instead of spaces :/
* Fix double-click on chat in buddy listRichard van der Hoff2015-10-191-33/+0
| | | | | Make sure we are consistent with the identifiers used for chats, so that double-clicking on the name of a chat in the buddy list switches to that chat.
* Display the messages we get on initial syncRichard van der Hoff2015-10-161-2/+0
| | | | | This code needs tidying up, and I need to figure out how to stop the messages appearing in the logs each time we commit, but it's clearly progress.
* Switch to v2 /sync APIRichard van der Hoff2015-10-161-12/+27
| | | | | initialSync is going away, so switch over before we get too far into the old way.
* Initial attempts at displaying a room in pidginRichard van der Hoff2015-10-161-0/+172
Not quite sure if this is the right approach yet - in particular, purple distinguishes between active 'conversations', as opposed to 'chats' in the buddy list. Which should our chats be?