Commit graph

279 commits

Author SHA1 Message Date
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
Denis Kasak
cb8b589bc9 Fix handling of empty room names.
When room names that were previously set get deleted, the server still
returns the name key, but set to the value of an empty string. Handle
this case as if there is no room name.
2018-03-08 11:08:44 +01:00
poljar (Damir Jelić)
207fb44bdc colors: Add markdown style italics support. 2018-03-06 22:57:57 +01:00
poljar (Damir Jelić)
16a2215cfc utils: Rename age to timestamp in server_ts_to_weechat. 2018-03-06 17:18:30 +01:00
poljar (Damir Jelić)
dc25487127 rooms: Add canonical alias event handling. 2018-03-06 17:17:54 +01:00
poljar (Damir Jelić)
e5b08f653a rooms: Don't use room aliases to change the buffer name. 2018-03-06 16:53:44 +01:00
poljar (Damir Jelić)
9a656d0432 rooms: Don't use event age, use their timestamp. 2018-03-06 16:53:04 +01:00
poljar (Damir Jelić)
51eb474477 rooms: Add more coloring to the membership messages. 2018-03-06 16:15:27 +01:00
poljar (Damir Jelić)
57718f82e9 rooms: Fix the nick in quit messages. 2018-03-06 16:02:46 +01:00
poljar (Damir Jelić)
a1b6087bf4 rooms: Print out membership events. 2018-03-06 15:52:30 +01:00
poljar (Damir Jelić)
996270df0d server: Only limit the sync if we don't have a next batch. 2018-03-06 13:53:34 +01:00
poljar (Damir Jelić)
01b8c44814 utils: Fix typo in tags formatting function. 2018-03-06 11:19:15 +01:00
Denis Kasak
b0872922ec Implement /kick. 2018-03-06 09:36:22 +01:00
Denis Kasak
7434285ffb Support weechat proxies. 2018-03-03 23:56:51 +01:00
poljar (Damir Jelić)
4a7b200ba4 utils: Align the user names in the nicklist. 2018-03-03 14:42:09 +01:00
Denis Kasak
d7485cc746 Always output HTML colors as hex codes. 2018-03-03 12:34:26 +01:00
Denis Kasak
8bb383220f Fix numbering comment for color "white". 2018-03-03 12:34:26 +01:00
Denis Kasak
cc993df68e Rename first_16 -> weechat_basic_colors. 2018-03-03 12:34:26 +01:00
Denis Kasak
59138a9824 if -> elif 2018-03-03 12:34:26 +01:00
Denis Kasak
c18c10774e Remove erroneously repeated condition. 2018-03-03 12:34:26 +01:00
Denis Kasak
f47e167023 Clarify help message for /redact. 2018-03-03 12:34:26 +01:00
Denis Kasak
86309740a0 Fix quotes in help message. 2018-03-03 12:34:26 +01:00