Commit graph

400 commits

Author SHA1 Message Date
poljar (Damir Jelić)
8a3bda9797 encryption: Stub functions for encrypted messages. 2018-05-09 14:00:32 +02:00
poljar (Damir Jelić)
320f490273 encryption: Only try to store the olm info if the olm object exists. 2018-05-06 15:04:19 +02:00
poljar (Damir Jelić)
8f7dac4a0d encryption: Change the way olm sessions are stored. 2018-05-06 15:03:50 +02:00
poljar (Damir Jelić)
658ec67ff4 encryption: Add a error message for the olm command. 2018-05-06 13:37:34 +02:00
poljar (Damir Jelić)
9e86ccc3f7 encryption: Add key printing support for queried keys. 2018-05-06 13:00:07 +02:00
poljar (Damir Jelić)
18bd62cb90 encryption: Add key query functionality. 2018-04-12 14:19:32 +02:00
poljar (Damir Jelić)
49eb6548d1 encryption: Fix olm decryption if we already have a session. 2018-04-11 20:56:11 +02:00
poljar (Damir Jelić)
0bd20cc333 encryption: Store the account and sessions in a sqlite db. 2018-04-11 14:00:37 +02:00
poljar (Damir Jelić)
8a162a7a80 encryption: Don't pass the server to the Olm class. 2018-04-11 13:45:12 +02:00
poljar (Damir Jelić)
1fd5bd637d encryption: Decrypt incomming messages. 2018-04-03 21:51:03 +02:00
poljar (Damir Jelić)
ec2995fe52 encryption: Add inbound session creation. 2018-03-29 11:41:01 +02:00
poljar (Damir Jelić)
f8c1f564ae olm: Mark one time keys as published and store the account. 2018-03-26 15:22:23 +02:00
poljar (Damir Jelić)
d28e6eb598 encryption: Add encrypt_enabled decorator to some functions. 2018-03-24 20:30:07 +01:00
poljar (Damir Jelić)
36cd12225b olm: One time key creation/uploading. 2018-03-24 20:30:07 +01:00
poljar (Damir Jelić)
27b376e1f5 olm: Upload the identity keys. 2018-03-24 20:30:07 +01:00
poljar (Damir Jelić)
823cc1bf28 olm: Save and restore the olm account keys. 2018-03-24 20:30:07 +01:00
poljar (Damir Jelić)
357c76edcc olm: Create a new olm account only after login.
That way we can be sure to have a valid device ID.
2018-03-24 20:30:07 +01:00
poljar (Damir Jelić)
b309be8a98 olm: Don't store the server in the olm class. 2018-03-24 20:30:07 +01:00
poljar (Damir Jelić)
c52b7866c8 Add olm account loading/creation and a initial olm command. 2018-03-24 20:30:07 +01:00
poljar (Damir Jelić)
45e6f742ec Fix device id loading. 2018-03-24 20:30:07 +01:00
poljar
508a80e981
Merge pull request #11 from dkasak/master
Fix charrefs.
2018-03-24 20:18:11 +01:00
Denis Kasak
fbec1c9f96 Remove stray print. 2018-03-24 14:40:03 +01:00
Denis Kasak
6e9275da7f Fix charrefs.
Forgot to include # when reconstructing charrefs from their "name".
2018-03-24 14:38:00 +01:00
poljar
6eec395254
Merge pull request #10 from dkasak/master
Handle combination of strikethrough and other attributes.
2018-03-23 11:59:59 +01:00
Denis Kasak
629eba1335 Use wrapped weechat module instead of using it directly. 2018-03-23 10:21:22 +01:00
Denis Kasak
42f34f749b Handle combination of strikethrough and other attributes.
Strikethrough has to be done first, before handling any other attribute,
because otherwise it doesn't render correctly.

The following changes were made:

1. When striking due to redaction, we simply strip all the other
   attributes and then do the strikethrough, because this is the only
   practical option.
2. When rendering rich text received from the server, we ensure we
   handle strikethrough first, before any other attribute.
2018-03-23 09:51:58 +01:00
poljar
13bfb33b73
Merge pull request #9 from dkasak/master
HTML ref parsing fix.
2018-03-22 21:10:52 +01:00
Denis Kasak
392698b9b5 MatrixHtmlParser: Factor out adding substrings into a method. 2018-03-22 20:47:10 +01:00
Denis Kasak
c6e34dd0b1 Escape each HTML ref individually. 2018-03-22 20:47:03 +01:00
poljar (Damir Jelić)
2915e5d288 rooms: Don't create membership messages from the state dict. 2018-03-22 11:08:14 +01:00
poljar (Damir Jelić)
5e7cd9e504 http: Add keep alive header to the requests. 2018-03-22 11:08:14 +01:00
poljar
808f652d5f
Merge pull request #7 from dkasak/unescape-html-entities
Unescape HTML entities prior to parsing HTML.
2018-03-19 15:21:10 +01:00
poljar (Damir Jelić)
c967731c0f events: Make sync event execution batched. 2018-03-19 14:55:48 +01:00
poljar (Damir Jelić)
a724d7fe58 rooms: Fix join event message creation. 2018-03-19 14:55:48 +01:00
poljar (Damir Jelić)
ee321b21d9 rooms: Restructure room info handling. 2018-03-19 14:55:48 +01:00
Denis Kasak
4be54d032e Implement MatrixHtmlParser.unescape shim.
This is for Python 2/3 compatibility, since Python 3 deprecates the
instance method and Python 2 doesn't have html.unescape.
2018-03-19 11:01:24 +01:00
Denis Kasak
0a868b80bb Add HTML character reference parsing test. 2018-03-19 11:01:24 +01:00
Denis Kasak
eea8936822 Unescape all HTML entities prior to parsing. 2018-03-19 11:01:24 +01:00
poljar
b4a315b6fa
Merge pull request #8 from dkasak/master
Improve .gitignore
2018-03-19 10:26:14 +01:00
Denis Kasak
d239eda675 Improve .gitignore 2018-03-19 10:22:06 +01:00
poljar (Damir Jelić)
416e154359 Fix tests for python2. 2018-03-18 23:31:57 +01:00
poljar (Damir Jelić)
3eef4a2f8b Add more dummy weechat module functions. 2018-03-18 23:31:57 +01:00
poljar (Damir Jelić)
34bf4ad65e rooms: Refactor out the event parsing in RoomInfo. 2018-03-18 23:31:57 +01:00
poljar
f5a45bc8aa
Merge pull request #6 from dkasak/todo-updates
Update TODO.
2018-03-17 17:44:34 +01:00
Denis Kasak
8af88918a1 Update TODO. 2018-03-17 00:28:53 +01:00
poljar (Damir Jelić)
c9d953dc4d colors: Fix index out of range error for markdown style emph. 2018-03-12 19:53:27 +01:00
poljar
0df199fd6f
Merge pull request #5 from dkasak/proper-names-for-private-chats
Improve room names.
2018-03-12 13:35:20 +01:00
Denis Kasak
e70f1e6042 Pass missing argument to display_name. 2018-03-12 13:24:36 +01:00
Denis Kasak
02bb64feab Remove usage of old MatrixRoom.alias attribute in remaining places.
* Use calculated display name in the bar item.
* Don't mention the room name in topic messages for groups.
2018-03-12 12:05:42 +01:00
Denis Kasak
654e39077d Improve room names.
We now track the room ID, the canonical alias and the name of the room
separately. Only the room ID is guaranteed to be set (instead of `None`).

Additionally, a number of methods were added to MatrixRoom to assist in
calculating the name of the room and determining whether it is a named
room or an ad hoc "group" of users.

The most important method is `MatrixRoom.display_name` which calculates
the display name of the room (roughly) according to section 11.2.2.5[*] of
the Matrix v0.3.0 spec.

[*] https://matrix.org/docs/spec/client_server/r0.3.0.html#id268
2018-03-09 23:59:33 +01:00