Commit graph

607 commits

Author SHA1 Message Date
Antoine Pietri
82d25e88ae Add media mimetype to emxc:// urls 2021-07-20 21:03:43 +02:00
Damir Jelić
d67821ae50 Merge branch 'bodqhrohro/master' 2021-06-06 21:08:43 +02:00
Bohdan Horbeshko
8461ad80f7 Fix misleading notices in keys import/export commands 2021-06-06 05:21:10 +03:00
Bohdan Horbeshko
6081b7eded Merge branch 'master' of https://github.com/poljar/weechat-matrix 2021-06-06 05:10:24 +03:00
Bohdan Horbeshko
f05a55a0af Support quoting for command arguments
I've encountered a problem when trying to use a passphrase with spaces in `/olm import`.
The arguments were just broken by spaces. shlex has more advanced splitting which allows
taking multi-word arguments in quotes.
2021-06-06 05:05:10 +03:00
James E. Blair
04be5a8764 Support short names for OFTC bridge 2021-05-25 20:11:37 -07:00
Filip Stedronsky
0d491bd3a6 Fix shortnames for Discord & Slack puppetting bridges 2021-05-01 15:59:47 +02:00
Toni Spets
b7e502526b Support Heisenbridge short names 2021-04-25 13:57:22 +03:00
Matthijs Kooijman
d24e6ce6a9 colors: Do not use [] indexing on re.match objects
This indexing (i.e. __getitem__) introduced in Python 3.5 as an alias of
the group method, so using it breaks this plugin on older Python
versions. In particular, messages containing urls cannot be sent and
result in an exception:

	File "matrix/colors.py", line 106, in <lambda>
	    lambda m: "a" * len(m[0]),
	TypeError: '_sre.SRE_Match' object has no attribute '__getitem__'

This commit replaces the use of the index operation / __getitem__ with
the group method, which is equivalent but supported on all python
versions.
2021-04-03 22:20:57 +02:00
Antoni Boucher
ef09292005 Fix condition to not force the user through the SSO process
Fix #260
2021-02-18 08:08:58 -05:00
Damir Jelić
e0cae8b418 buffer: The encryption warning sign is in the look section. 2020-12-15 22:41:34 +01:00
Yuri D'Elia
7239d48b95 Use the configured warning sign in the buffer prefix 2020-11-20 18:04:19 +01:00
user202729
8ee1a77d16 Only clear backlog_pending flag if the error is an instance of RoomMessagesError 2020-11-11 20:41:17 +07:00
user202729
a09aa4d4fc Set backlog_pending to false on error 2020-11-07 22:00:20 +07:00
kraem
704fdc2f70
buffer: Expose canonical_alias as localvar in buffer 2020-10-03 22:50:49 +02:00
Tom Smeding
73e9d1d9d3 Use True as default value for markdown_input in tests 2020-08-29 20:18:56 +02:00
Tom Smeding
e74a5a2041 Toggle markdown parsing with matrix.look.markdown_input 2020-08-25 22:31:57 +02:00
Tom Smeding
fab8bb37bf Reply to messages with 'r' binding in cursor mode 2020-07-02 17:51:18 +02:00
Tom Smeding
de1d3d4664 Make buffer name prefix a global constant 2020-07-02 17:27:20 +02:00
Tom Smeding
439389db4d Use G.SCRIPT_NAME for buffer name namespace prefix 2020-07-02 16:40:12 +02:00
Tom Smeding
00f5849500 Namespace buffers with "matrix."
This allows setting key bindings specifically for matrix buffers
2020-07-02 16:29:01 +02:00
Damir Jelić
cd90256e69 server: Always use the option initial sync events for the initial sync. 2020-06-22 19:42:08 +02:00
Damir Jelić
8b5ae9d80d server: Lower the sync limit. 2020-06-22 19:42:08 +02:00
Denis Kasak
71b7f79317 Make nick prefix (&, @, +) colour configurable. 2020-06-08 20:41:59 +02:00
Tom Smeding
7fdd7eb910 Use URLs, not URL's 2020-06-08 20:41:59 +02:00
Tom Smeding
d37e08cce2 Don't process markdown in URL's 2020-06-08 20:41:59 +02:00
Denis Kasak
16825451c7 Fix nicklist grouping of users with the + prefix.
The wrong comparison operator was used. Most likely a leftover from when
the function used power levels directly.
2020-06-07 14:37:42 +02:00
Tom Smeding
397acef2bd Escape manually entered html characters
Previously, the behaviour was inconsistent; if there was no other
formatting, weechat-matrix doesn't send formatted_body, and Riot would
display the message as-is. If there _was_ other formatting,
formatted_body is sent without escaping of the HTML characters, so that
Riot would interpret them as HTML.

This makes both cases consistent, using the first behaviour.
2020-06-04 15:08:45 +02:00
Denis Kasak
126c55b3ea
Merge pull request #204 from tomsmeding/reply-quotes
Allow quotes in replied-to messages
2020-06-03 11:31:31 +00:00
Tom Smeding
a5e6434c31
Fix handling of backslashes in relation to code blocks (#203)
Backslashes are now correctly preserved inside code blocks while still allowing the user to escape a backtick. The handling of backticks and bold/italic wrappers was unified so that they share the same escaping code.

Backslashes only escape Markdown wrapper characters (*, _, `). If they are encountered before another character, they are considered literal.
2020-06-03 11:06:16 +00:00
Tom Smeding
d5636bd186 Require text in reply-matrix 2020-06-02 09:42:28 +02:00
Tom Smeding
6aff7ddcbb Escape quotes in reply/redact completion message hints 2020-06-02 09:41:35 +02:00
Denis Kasak
5191b596f3 Allow mixing of code and colours with other attrs when outputting HTML. 2020-05-31 14:44:04 +02:00
Tom Smeding
170c5811a3
Better half-markdown (#202)
Better half-markdown.

This fixes some issues with the current semi-markdown-parser to make life easier until a full markdown parser is implemented.

Changes:
- A * that would normally start italics but isn't matched by a closing *, is now left alone.
- A ` that would normally start a code block but isn't matched by a closing `, is now left alone.
- Backslashes should work as expected.
- Support for **bold** and the alternative _italic_ style.
2020-05-31 12:09:29 +00:00
Tom Smeding
0ce5b65835 Properly handle newlines in quote blocks 2020-05-29 21:29:44 +02:00
Tom Smeding
b4a3aabad9 Add quote_wrap option 2020-05-29 11:26:53 +02:00
Joram Schrijver
efd4786996 server: fix typo in config callback error return 2020-05-23 00:51:59 +02:00
Damir Jelić
427cb9f0be Merge branch 'rudis-master' 2020-05-13 17:07:11 +02:00
Damir Jelić
06d04b5152 Merge branch 'feat/enable-replies' 2020-05-13 17:06:54 +02:00
Simon Ruderich
87d8032070 Fix typos in messages and comments 2020-05-13 08:28:37 +02:00
Imran Iqbal
af7049f2cf
feat(replies): enable based on redaction implementation
* Close #86
* https://matrix.org/docs/spec/client_server/latest#rich-replies
* Modify to `/reply-matrix` to avoid clash with `/reply` used by `wee-slack`
2020-05-10 17:47:56 +01:00
Damir Jelić
196e66f74a Merge branch 'pr/olm_missing_category' 2020-05-10 10:19:51 +02:00
Damir Jelić
d750d3ba1f Merge branch 'pr/olm_verification_msg_args' 2020-05-10 10:12:15 +02:00
Qeole
5889d50a0d commands: prevent python crash when typing simply "/olm"
Typing "/olm" on its own is supposed to fall back to the default
subcommand "/olm info private". It does pick up "info", but fails to
find a "category" (in our case: we want "private") because the category
has never been parsed, and has never been assigned to "args". Not only
does the command fail, but it even yields a traceback:

    python : stdout/stderr (matrix) : Traceback (most recent call last):
    python : stdout/stderr (matrix) :   File "/home/qmo/weechat/conf/python/matrix/utf.py", line 89, in wrapper
    python : stdout/stderr (matrix) :     return function(*args, **kwargs)
    python : stdout/stderr (matrix) :   File "/home/qmo/weechat/conf/python/matrix/commands.py", line 891, in matrix_olm_command_cb
    python : stdout/stderr (matrix) :     return command(server, data, buffer, args)
    python : stdout/stderr (matrix) :   File "/home/qmo/weechat/conf/python/matrix/commands.py", line 860, in command
    python : stdout/stderr (matrix) :     olm_info_command(server, parsed_args)
    python : stdout/stderr (matrix) :   File "/home/qmo/weechat/conf/python/matrix/commands.py", line 594, in olm_info_command
    python : stdout/stderr (matrix) :     if args.category == "private":
    python : stdout/stderr (matrix) : AttributeError: 'Namespace' object has no attribute 'category'

Fix it by going for "private" if no category has been assigned.

Fixes: 1208c9d4a2 ("commands: Add initial olm command.")
2020-05-10 01:29:44 +01:00
Qeole
9fcf1af922 commands: fix user/device ids in error messages for "/olm verification"
When passing arguments to format error messages for "/olm verification",
the order of device id and user id has been swapped, leading to
confusing messages. Let's restore the correct order.

Fixes: 9f01a05617 ("commands: Add a command for interactive key verification.")
2020-05-10 01:25:29 +01:00
Imran Iqbal
b74b8e089d
fix(commands.py): fix minor typo diconnected => disconnected 2020-05-09 14:09:28 +01:00
Maze
a5bed102e5 placeholder is now "Empty room (?)" 2020-01-21 21:36:31 +01:00
Maze
959a2fc77d placeholder room name 2020-01-21 21:08:45 +01:00
Damir Jelić
c1b8fe97c3 buffer: Unknown events nowadays have a source. 2019-12-04 22:44:49 +01:00
Marco Sirabella
6d58ff0695
Get the tests passing 2019-11-22 18:44:07 -05:00