Code Monkey home page Code Monkey logo

weechat-matrix's Introduction

Build Status #weechat-matrix license

What is Weechat-Matrix?

Weechat is an extensible chat client.

Matrix is an open network for secure, decentralized communication.

weechat-matrix is a Python script for Weechat that lets Weechat communicate over the Matrix protocol.

Project Status

weechat-matrix is stable and quite usable as a daily driver. It already supports large parts of the Matrix protocol, including end-to-end encryption (though some features like cross-signing and session unwedging are unimplemented).

However, due to some inherent limitations of Weechat scripts, development has moved to weechat-matrix-rs, a Weechat plugin written in Rust. As such, weechat-matrix is in maintenance mode and will likely not be receiving substantial new features. PRs are still accepted and welcome.

Installation

Arch Linux

Packaged as community/weechat-matrix.

pacman -S weechat-matrix

Alpine Linux

apk add weechat-matrix

Then follow the instructions printed during installation to make the script available to weechat.

Other platforms

  1. Install libolm 3.1+

    • Debian 11+ (testing/sid) or Ubuntu 19.10+ install libolm-dev

    • FreeBSD pkg install olm

    • macOS brew install libolm

    • Failing any of the above see https://gitlab.matrix.org/matrix-org/olm for instructions about building it from sources

  2. Clone the repo and install dependencies

    git clone https://github.com/poljar/weechat-matrix.git
    cd weechat-matrix
    pip install --user -r requirements.txt
    
  3. As your regular user, just run: make install in this repository directory.

    This installs the main python file (main.py) into ~/.weechat/python/ (renamed to matrix.py) along with the other python files it needs (from the matrix subdir).

    Note that weechat only supports Python2 OR Python3, and that setting is determined at the time that Weechat is compiled. Weechat-Matrix can work with either Python2 or Python3, but when you install dependencies you will have to take into account which version of Python your Weechat was built to use.

    The minimal supported python2 version is 2.7.10.

    The minimal supported python3 version is 3.5.4 or 3.6.1.

    To check the python version that weechat is using, run:

    /python version
    

Using virtualenv

If you want to install dependencies inside a virtualenv, rather than globally for your system or user, you can use a virtualenv. Weechat-Matrix will automatically use any virtualenv it finds in a directory called venv next to its main Python file (after resolving symlinks). Typically, this means ~/.weechat/python/venv.

To create such a virtualenv, you can use something like below. This only needs to happen once:

virtualenv ~/.weechat/python/venv

Then, activate the virtualenv:

. ~/.weechat/python/venv/bin/activate

This needs to be done whenever you want to install packages inside the virtualenv (so before running the pip install command documented above.

Once the virtualenv is prepared in the right location, Weechat-Matrix will automatically activate it when the script is loaded. This should not affect other script, which seem to have a separate Python environment.

Note that this only supports virtualenv tools that support the activate_this.py way of activation. This includes the virtualenv command, but excludes pyvenv and the Python3 venv module. In particular, this works if (for a typical installation of matrix.py) the file ~/.weechat/python/venv/bin/activate_this.py exists.

Run from git directly

Rather than copying files into ~/.weechat (step 3 above), it is also possible to run from a git checkout directly using symlinks.

For this, you need two symlinks:

ln -s /path/to/weechat-matrix/main.py ~/.weechat/python/matrix.py
ln -s /path/to/weechat-matrix/matrix ~/.weechat/python/matrix

This first link is the main python file, that can be loaded using /script load matrix.py. The second link is to the directory with extra python files used by the main script. This directory must be linked as ~/.weechat/python/matrix so it ends up in the python library path and its files can be imported using e.g. import matrix from the main python file.

Note that these symlinks are essentially the same as the files that would have been copied using make install.

Uploading files

Uploads are done using a helper script, which is found under contrib/matrix_upload. We recommend you install this under your PATH as matrix_upload (without the .py suffix). Uploads can be done from Weechat with: /upload <file>.

Downloading encrypted files

Encrypted files are displayed as an emxc:// URI which cannot be directly opened. They can be opened in two different ways:

  • In the CLI by running the contrib/matrix_decrypt helper script.

  • In the browser by using matrix-decryptapp. This is a static website which cannot see your data, all the decryption happens on the client side. You can either host it yourself or directly use the instance hosted on seirl.github.io. This weechat trigger will convert all your emxc:// URLs into clickable https links:

    /trigger addreplace emxc_decrypt modifier weechat_print "" ";($|[^\w/#:\[])(emxc://([^ ]+));${re:1}https://seirl.github.io/matrix-decryptapp/#${re:2};"
    

Configuration

Configuration is completed primarily through the Weechat interface. First start Weechat, and then issue the following commands:

  1. Start by loading the Weechat-Matrix script:

    /script load matrix.py
    
  2. Now set your username and password:

    /set matrix.server.matrix_org.username johndoe
    /set matrix.server.matrix_org.password jd_is_awesome
    
  3. Now try to connect:

    /matrix connect matrix_org
    
  4. Automatically load the script

    $ ln -s ../matrix.py ~/.weechat/python/autoload
    
  5. Automatically connect to the server

    /set matrix.server.matrix_org.autoconnect on
    
  6. If everything works, save the configuration

    /save
    

For using a custom (not matrix.org) matrix server:

  1. Add your custom server to the script:

    /matrix server add myserver myserver.org
    
  2. Add the appropriate credentials

    /set matrix.server.myserver.username johndoe
    /set matrix.server.myserver.password jd_is_awesome
    
  3. If everything works, save the configuration

    /save
    

Single sign-on:

Single sign-on is supported using a helper script, the script found under contrib/matrix_sso_helper should be installed under your PATH as matrix_sso_helper (without the .py suffix).

For single sign-on to be the preferred leave the servers username and password empty.

After connecting a URL will be presented which needs to be used to perform the sign on. Please note that the helper script spawns a HTTP server which waits for the sign-on token to be passed back. This makes it necessary to do the sign on on the same host as Weechat.

A hsignal is sent out when the SSO helper spawns as well, the name of the hsignal is matrix_sso_login and it will contain the name of the server in the server variable and the full URL that can be used to log in in the url variable.

To open the login URL automatically in a browser a trigger can be added:

    /trigger add sso_browser hsignal matrix_sso_login "" "" "/exec -bg firefox ${url}"

If signing on on the same host as Weechat is undesirable the listening port of the SSO helper should be set to a static value using the sso_helper_listening_port setting:

   /set matrix.server.myserver.sso_helper_listening_port 8443

After setting the listening port the same port on the local machine can be forwarded using ssh to the remote host:

    ssh -L 8443:localhost:8443 example.org

This forwards the local port 8443 to the localhost:8443 address on example.org. Note that it is necessary to forward the port to the localhost address on the remote host because the helper only listens on localhost.

Bar items

There are two bar items provided by this script:

  1. matrix_typing_notice - shows the currently typing users

  2. matrix_modes - shows room and server info (encryption status of the room, server connection status)

They can be added to the weechat status bar as usual: /set weechat.bar.status.items

The matrix_modes bar item is replicated in the already used buffer_modes bar item.

Typing notifications and read receipts

The sending of typing notifications and read receipts can be temporarily disabled for a given room via the /room command. They can also be permanently configured using standard weechat conditions settings with the following settings:

  1. matrix.network.read_markers_conditions
  2. matrix.network.typing_notice_conditions

Cursor bindings

While you can reply on a matrix message using the /reply-matrix command (see its help in weechat), weechat-matrix also adds a binding in /cursor mode to easily reply to a particular message. This mode can be triggered either by running /cursor, or by middle-clicking somewhere on the screen. See weechat's help for /cursor.

The default binding is:

/key bindctxt cursor @chat(python.matrix.*):r hsignal:matrix_cursor_reply

This means that you can reply to a message in a Matrix buffer using the middle mouse button, then r.

This binding is automatically set when the script is loaded and there is no such binding yet. If you want to use a different key than r, you can execute the above command with a different key in place of r. To use modifier keys like control and alt, use alt-k, then your wanted binding key combo, to enter weechat's representation of that key combo in the input bar.

Navigating room buffers using go.py

If you try to use the go.py script to navigate buffers created by weechat-matrix, go.py will by default use the full buffer name which does not contain a human-readable room display name but only the Matrix room ID. This is necessary so that the logger file is able to produce unique, permanent filenames for a room.

However, buffers also have human-readable short names. To make go.py use the short names for navigation, you can run the following command:

/set plugins.var.python.go.short_name "on"

As an alternative, you can also force weechat-matrix to use human-readable names as the full buffer names by running

/set matrix.look.human_buffer_names on

Beware that you will then also need to adjust your logger setup to prevent room name conflicts from causing logger file conflicts.

Helpful Commands

/help matrix will print information about the /matrix command.

/help olm will print information about the /olm command that is used for device verification.

/matrix help [command] will print information for subcommands, such as /matrix help server

weechat-matrix's People

Contributors

0mp avatar adrijaned avatar bodqhrohro avatar diabonas avatar dkasak avatar dset0x avatar hifi avatar jspricke avatar kechpaja avatar komputerwiz avatar lecler-i avatar matthijskooijman avatar mjsir911 avatar mraagh avatar myii avatar nibalizer avatar poljar avatar ptman avatar qeole avatar rexroni avatar rudis avatar schopin-pro avatar seirl avatar strk avatar tomsmeding avatar trygveaa avatar tulir avatar tylerjw avatar user202729 avatar wavexx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weechat-matrix's Issues

How to do basic setup for testing/dev?

I read the TODO.md and it looks like this project has a lot of functionality already. However, when I downloaded it and ran make install, opened weechat, and called /python load matrx, I get the following error:

python: function "register" not found (or failed) in file: "$HOME/.weechat/python/matrix"

Am I missing something basic? Could it be a python2 vs python3 issue? (my system runs python3 by default).

Anyway, I also saw that no work has been done on the OLM portion of the code, which my friend and I have been learning about to try to fix the lua matrix plugin. We could potentially help with your project as well.

Is it ready for the encryption to be added?

feature request - channel groups

as the number of protocols I use in matrix grows, I think it would be useful to have multiple groups of channels, one for slack, one for native matrix, so on and so forth.

could be notated something like:
homeserver_slack
main
team1
homeserver_freenode
#matrix
#weechat

or something similar

Smart nick completion

Apparently irc.look.nick_completion_smart in weechat is specific to IRC. Would be very nice to have similar smart completion in matrix as well.

Verify all devices in channel

I looked through the command code but couldn't figure a way to verify all devices in a room. Is there currently a way to do this?

In encrypted rooms with more than a couple users, this becomes quite some labor - especially when devices has been verified previously and you just need to get a new baseline.

Issue installing - missing python-olm.git@master

Hi,

Running pip2.7 install -r requirements.txt on OpenBSD results in the following error. Am I overlooking anything here, or is there something missing in the python-olm repo?

  Could not find a version that satisfies the requirement python-olm@ git+https://github.com/poljar/python-olm.git@master#egg=python-olm-0 (from matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9)) (from versions: )

I assume this isn't anything platform-specific, but I'll leave that open as well.

Status items of other python scripts are overwritten

When I use this together with wee-slack, most of the status line in the slack buffers become empty. I.e. one example is [23:41] [104] 46:, without name, user count etc.

This is because weechat-matrix overwrites the default status bar items by calling bar_item_new on existing items. I'm not sure what the correct method to set the contents of these items is though.

'OlmEvent' object has no attribute 'transaction_id'

i just gave the plugin a quick spin - looks super promising :) I built python-olm against latest olm from git.matrix.org, and matrix-nio against that, and loaded it up into weechat-2.4. however, on connection, i get:

python: stdout/stderr (matrix): Traceback (most recent call last):
python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/utf.py", line 91, in wrapper
python: stdout/stderr (matrix):     return function(*decode_from_utf8(args), **decode_from_utf8(kwargs))
python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix.py", line 317, in receive_cb
python: stdout/stderr (matrix):     server.handle_response(response)
python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/server.py", line 1307, in handle_response
python: stdout/stderr (matrix):     self._handle_sync(response)
python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/server.py", line 1199, in _handle_sync
python: stdout/stderr (matrix):     self._handle_room_info(response)
python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/server.py", line 1135, in _handle_room_info
python: stdout/stderr (matrix):     room_buffer.handle_joined_room(info)
python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/buffer.py", line 1676, in handle_joined_room
python: stdout/stderr (matrix):     self.handle_timeline_event(event)
python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/buffer.py", line 1275, in handle_timeline_event
python: stdout/stderr (matrix):     if event.transaction_id:
python: stdout/stderr (matrix): AttributeError: 'OlmEvent' object has no attribute 'transaction_id'
python: error in function "receive_cb"

Crash/exit on load

Try to install requrements:

$ pip2 install --user -r requirements.txt
Requirement already satisfied: pyOpenSSL in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 1))
Collecting typing (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/cc/3e/29f92b7aeda5b078c86d14f550bf85cff809042e3429ace7af6193c3bc9f/typing-3.6.6-py2-none-any.whl
Collecting webcolors (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/1d/44/c4902683be73beba20afd299705e11f0a753a01cc7f9d6a070841848605b/webcolors-1.8.1-py2.py3-none-any.whl
Collecting future (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz (829kB)
    100% |████████████████████████████████| 829kB 917kB/s
Collecting atomicwrites (from -r requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/52/90/6155aa926f43f2b2a22b01be7241be3bfd1ceaf7d0b3267213e8127d41f4/atomicwrites-1.3.0-py2.py3-none-any.whl
Collecting attrs (from -r requirements.txt (line 6))
  Downloading https://files.pythonhosted.org/packages/23/96/d828354fa2dbdf216eaa7b7de0db692f12c234f7ef888cc14980ef40d1d2/attrs-19.1.0-py2.py3-none-any.whl
Collecting logbook (from -r requirements.txt (line 7))
  Downloading https://files.pythonhosted.org/packages/f6/83/20fc0270614919cb799f76e32cf143a54c58ce2fa45c19fd38ac2e4f9977/Logbook-1.4.3.tar.gz (85kB)
    100% |████████████████████████████████| 92kB 1.0MB/s
Collecting pygments (from -r requirements.txt (line 8))
  Downloading https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl (849kB)
    100% |████████████████████████████████| 849kB 549kB/s
Collecting matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0 (from -r requirements.txt (line 9))
  Could not find a version that satisfies the requirement matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0 (from -r requirements.txt (line 9)) (from versions: )
No matching distribution found for matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0 (from -r requirements.txt (line 9))

Um, clone matrix-nio manually and install the dependencies from it... pycrypto configure script can't figure out how to invoke gcc. Install pycrypto from gentoo, try again, it works.
Install with make install, copy nio directory next to matrix (because of the pip problem above), try /script load matrix.py test.
Figure out olm is missing from the dependencies. Install it manually, and try again:
Weechat just exits. No error message, no SIGSEGV in dmesg, it just exits with exit code 2. At least the older lua implementation more or less worked.

Weechat 2.3, Python 2.7, gentoo stable.

AttributeError: 'NoneType' object has no attribute 'lag'

Upon loading the module in weechat (python2) the weechat buffer constantly spits out error messages of the type in the title for various functions, the script does not load and cannot be used.

  =!= python: error in function "matrix_timer_cb"
  python: stdout/stderr (matrix): Traceback (most recent call last):
  python: stdout/stderr (matrix):   File "/home/zet/.weechat/python/matrix/utf.py", line 91, in wrapper
  python: stdout/stderr (matrix):     return function(*decode_from_utf8(args), **decode_from_utf8(kwargs))
  python: stdout/stderr (matrix):   File "/home/zet/.weechat/python/matrix/server.py", line 1614, in matrix_timer_cb
  python: stdout/stderr (matrix):     server.lag = server.client.lag * 1000
  python: stdout/stderr (matrix): AttributeError: 'NoneType' object has no attribute 'lag'
  =!= python: error in function "matrix_timer_cb"
  python: stdout/stderr (matrix): Traceback (most recent call last):
  python: stdout/stderr (matrix):   File "/home/zet/.weechat/python/matrix/utf.py", line 91, in wrapper
  python: stdout/stderr (matrix):     return function(*decode_from_utf8(args), **decode_from_utf8(kwargs))
  python: stdout/stderr (matrix):   File "/home/zet/.weechat/python/matrix/server.py", line 1614, in matrix_timer_cb
  python: stdout/stderr (matrix):     server.lag = server.client.lag * 1000
  python: stdout/stderr (matrix): AttributeError: 'NoneType' object has no attribute 'lag'
  =!= python: error in function "matrix_timer_cb"
  python: stdout/stderr (matrix): Traceback (most recent call last):
  python: stdout/stderr (matrix):   File "/home/zet/.weechat/python/matrix/utf.py", line 91, in wrapper
  python: stdout/stderr (matrix):     return function(*decode_from_utf8(args), **decode_from_utf8(kwargs))
  python: stdout/stderr (matrix):   File "/home/zet/.weechat/python/matrix/server.py", line 1614, in matrix_timer_cb
  python: stdout/stderr (matrix):     server.lag = server.client.lag * 1000
  python: stdout/stderr (matrix): AttributeError: 'NoneType' object has no attribute 'lag'
  =!= python: error in function "matrix_timer_cb"

the matrix server buffer loads, but the actual rooms do not, I have bisected the git tree, this appears to have been introduced in:
c680939

If my understanding is correct, this is likely something that simply needs a typecast

Untrusted devices notice doesn't reappar over time when new devices present thus causing problems on the receivers' end

I've had an occurrence of an issue where after about 2-3 days of having weechat-matrix loaded and connected to a network, the (Untrusted devices found in room...) notice would no longer appear when new untrusted devices were present, thus causing any messages sent from inside weechat-matrix to be unreadable to the users with these untrusted devices, and causing them to receive this message:

** Unable to decrypt: The sender's device has not sent us the keys for this message. **
Re-request encryption keys from your other devices.

Reloading the script caused it to function as intended again.

weird mangling on receiving e2e messages from unverified devices

so, good news: i can receive e2e messages!

bad news: they're pretty mangled (at least in weechat in a screen)

riot sees:

screenshot 2019-02-23 at 23 24 32

weechat shows:

23:19:00        =!= | matrix: This room is encrypted, encryption is currently unsuported. Message sending is disabled for this room.  
22:43:12 M-b~ZM- M- | test&matthew                                                                                                    
23:19:27 M-b~ZM- M- | rightmatthew                                                                                                    
23:19:29 M-b~ZM- M- | any better?w                                                                                                    
23:20:15        =!= | matrix: Untrusted devices found in room: Device NBHCUILQXV for user @matthew:matrix.org is not verified or      
                    | blacklisted.                                                                                                    

however, having run /olm verify @matthew:matrix.org *, it now seems to be working for receiving okay?

Makefile OpenBSD compat

The patsubst and wildcard is specific go Gnu Make and doesn't work on OpenBSD. I believe this line is the issue:

lib := $(patsubst matrix/%.py, $(DESTDIR)$(PREFIX)/python/matrix/%.py, \
     $(wildcard matrix/*.py))

I've worked around it by using gmake instead, but it would have been nice to have native compatibility.

"Error while reading from socket" on slow connections

If network latency to the homeserver is quite high (~200-500 ms), sometimes client drops connection to the server with message:

matrix: Error while reading from socket

and reconnects.

I quickly checked the code and it seems to be related to the clause when receive_cb receives no data from socket but also receives no error/exception, which, I assume, could happen with non-blocking socket and slow connections.

I am using:
poljar/matrix-nio 9fbe20f6b3f7624d3b8d57a333835fbd641b579d
poljar/python-olm b4c8af18954b6b018c6cef436bd3cc2132b5d2cd
olm-3.0.0
poljar/weechat-matrix branch device-olm 11b960e

/script load matrix.py test fails on OpenBSD

  • virtualenv in /usr/local/py-matrix-weechat (This is for wxallowed on OpenBSD) and was configured to use system packages where available.
  • gmake was used in weechat-matrix to install files .
  • Python 2.7.
  • Weechat 2.3.
  • OLM 3.0.0

/script load matrix.py test results in:

2019-02-15 06:34:27     =!=     python: unable to parse file "/home/qbit/.weechat/python/matrix.py"
2019-02-15 06:34:27             script: unknown language for script "test"
2019-02-15 06:35:39             python: loading script "/home/qbit/.weechat/python/matrix.py"
2019-02-15 06:35:42             python: stdout/stderr (?): Traceback (most recent call last):
2019-02-15 06:35:42             python: stdout/stderr (?):   File "/home/qbit/.weechat/python/matrix.py", line 34, in <module>
2019-02-15 06:35:42             python: stdout/stderr (?):     from nio import RemoteProtocolError, RemoteTransportError, TransportType
2019-02-15 06:35:42             python: stdout/stderr (?):   File "/usr/local/py-matrix-weechat/lib/python2.7/site-packages/nio/__init__.py", line 2, in <module>
2019-02-15 06:35:42             python: stdout/stderr (?):     from .client import HttpClient, TransportType, Client
2019-02-15 06:35:42             python: stdout/stderr (?):   File "/usr/local/py-matrix-weechat/lib/python2.7/site-packages/nio/client.py", line 48, in <module>
2019-02-15 06:35:42             python: stdout/stderr (?):     from .crypto import DeviceStore, Olm
2019-02-15 06:35:42             python: stdout/stderr (?):   File "/usr/local/py-matrix-weechat/lib/python2.7/site-packages/nio/crypto/__init__.py", line 19, in <module>
2019-02-15 06:35:42             python: stdout/stderr (?):     from .olm_machine import Olm
2019-02-15 06:35:42             python: stdout/stderr (?):   File "/usr/local/py-matrix-weechat/lib/python2.7/site-packages/nio/crypto/olm_machine.py", line 74, in <module>
2019-02-15 06:35:42             python: stdout/stderr (?):     from ..responses import (
2019-02-15 06:35:42             python: stdout/stderr (?):   File "/usr/local/py-matrix-weechat/lib/python2.7/site-packages/nio/responses.py", line 640, in <module>
2019-02-15 06:35:42             python: stdout/stderr (?):     class KeysQueryResponse(Response):
2019-02-15 06:35:42             python: stdout/stderr (?):   File "/usr/local/py-matrix-weechat/lib/python2.7/site-packages/nio/responses.py", line 646, in KeysQueryResponse
2019-02-15 06:35:42             python: stdout/stderr (?):     factory=dict
2019-02-15 06:35:42             python: stdout/stderr (?): TypeError: attrib() got an unexpected keyword argument 'factory'
2019-02-15 06:35:42     =!=     python: unable to parse file "/home/qbit/.weechat/python/matrix.py"

Server Buffers in Wrong Location

All of the server buffers for matrix servers are attached to the main weechat buffer. This means that they contain the same log messages minus the prefix. Additionally, if you try to move any one of the buffers around they it will move the weechat buffer along with all the matrix server buffers. I am not able to drag channels in between multiple matrix servers.
Right now all of the matrix channels I'm in are added after my weeslack buffers (after the last weeslack channel).

Nicks in nick list do not resemble nicks in message buf

Not sure if this is intended, but the nicks of folks in matrix channels are in the format @:. This conflicts with the way that IRC uses @ to designate OP (not that it has much meaning on matrix), but also the way nicks are displayed in the message portion of the buffer is different than how they show in the nick list, so mentioning a nick is awkward/difficult since you have to know how it shows in the nick list in order for tab completion to work.

I can take a shot at fixing this if this is something you think should be improved (e.g. nicks in message portion of buffer == nicks in nick list).

Cannot connect to homeserver behind an NGINX reverse proxy

I have a standard setup. NGINX listening on 443 (ssl, http2) proxying to synapse with the client port listening on localhost. The only way I can get the plugin to connect is by setting the port to my federation port and disabling SSL validity checking.

matrix: Error while reading from socket is the only error message, even after turning on debugging.

I don't even see my IP hitting the synapse or NGINX logs. No server-side errors either. The output indicates the TLS handshake completed successfully - I'm just using a standard Let's Encrypt cert.

Is there a known-good NGINX configuration I should be using? No other clients have this issue.

can't type on an encrypted channel[fixed]

and I believe I have accepted all keys.. I can read fine, just can't type anything... I am trying to look at the code to see if there is an option for this but so far can't see one.. so sorry if I am missing an option or something.

everytime I do a /join /olm verify etc I have to restart weechat

sorry for all the QA im doing :)
when I add a friend this is whats happening:

- friends come into channel
- I can type but he wont see it
- I try /olm verify @friend:server.org
- nothing happens I check status buffer, and says can't find it.. I try with * etc same result
- I restart weechat, then I do the /olm verify again, now works and I get the keys
- now I can't type on channel... 
- I need to /reload (sometimes this fixex it) most times I need to yet again restart weechat

for /join

- I want to join a channel lets say #cyberpunk:hispagatos.org
- I type /join #cyberpunk:hispagatos.org
- I do not see it listed.. nothing on my status buffer
- I restart weechat
- then I can see it .. 

<unable to decrypt> error with weechat-matrix device and riot device for same account

Steps to reproduce:

  1. Create an encrypted room.
  2. Invite two accounts both of which use weechat-matrix
  3. Add another riot web device to one of those accounts

from time to time it breaks the encryption so one or both weechat-matrix clients cannot read each other but always can read riot messages, sometimes it heals itself after a day of idling but sometimes it is not.
This issue quite intermittent and hard to reproduce so I would really appreciate some help with setting up logging from matrix-nio to be able to debug it.

I am using:
poljar/matrix-nio 9fbe20f6b3f7624d3b8d57a333835fbd641b579d
poljar/python-olm b4c8af18954b6b018c6cef436bd3cc2132b5d2cd
olm-3.0.0
poljar/weechat-matrix branch device-olm 11b960e

No matching distribution found for matrix-nio

$ pip2 install -r requirements.txt --user
Requirement already satisfied: pyOpenSSL in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied: typing in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 2))
Collecting webcolors (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/1d/44/c4902683be73beba20afd299705e11f0a753a01cc7f9d6a070841848605b/webcolors-1.8.1-py2.py3-none-any.whl
Collecting future (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz
Collecting atomicwrites (from -r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/52/90/6155aa926f43f2b2a22b01be7241be3bfd1ceaf7d0b3267213e8127d41f4/atomicwrites-1.3.0-py2.py3-none-any.whl
Requirement already satisfied: attrs in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 6))
Requirement already satisfied: logbook in /home/anon/.local/lib64/python2.7/site-packages (from -r requirements.txt (line 7))
Requirement already satisfied: pygments in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 8))
Collecting matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0 (from -r requirements.txt (line 9))
  Could not find a version that satisfies the requirement matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0 (from -r requirements.txt (line 9)) (from versions: )
No matching distribution found for matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0 (from -r requirements.txt (line 9))

As above, requirements.txt might need updating. Tested on Gentoo and Ubuntu 18.04.

keep getting disconnected

Not sure why or if I need to twink/add/change a time out setting or something but I keep getting disconnected and then connected over and over...
any idea?
thanks

Python-crypto

I don't know much about python so I'm not sure if it is something I'm doing wrong or not.

I'm running Archlinux and I do have python-crypto installed

if I open a python cli and type import OpenSSL.crypto I get no errors
but when I run
/script load matrix.py on my weechat I see this message: No module named OpenSSL.crypto

Just wondering what I'm doing wrong here.

log messages:

20:45 python: loading script "/home/thiago/.dotfiles/weechat/python/matrix.py"
20:45 python: stdout/stderr (colorize_nicks): Traceback (most recent call last):
20:45 python: stdout/stderr (?): Traceback (most recent call last):
20:45 python: stdout/stderr (colorize_nicks):   File "/home/thiago/.dotfiles/weechat/python/matrix.py", line 24, in <module>
20:45 python: stdout/stderr (?):   File "/home/thiago/.dotfiles/weechat/python/matrix.py", line 24, in <module>
20:45 python: stdout/stderr (colorize_nicks):     import OpenSSL.crypto as crypto
20:45 python: stdout/stderr (?):     import OpenSSL.crypto as crypto
20:45 python: stdout/stderr (colorize_nicks): ImportError: No module named OpenSSL.crypto
20:45 python: stdout/stderr (?): ImportError: No module named OpenSSL.crypto
20:45 =!= python: unable to parse file "/home/thiago/.dotfiles/weechat/python/matrix.py"

Kick reason is None

This is a minor one, but the reason for kicking a user is shown like the following on my side:

[...] (None) has been kicked from <ROOM_NAME>

Fails to install python-olm-dev, No such file or directory #include <olm/pk.h>

When I try to pip install the requirements, it fails on python-olm-dev. The weechat-matrix README suggests to install libolm-dev from apt, but if that is intended to provide the headers, I guess it doesn't.

I provide a Dockerfile below to suggest how to reproduce the issue, as well the output included in a folded section.

To solve the issue for me, It seems we can add git clone https://git.matrix.org/git/olm.git and make install.

FROM ubuntu

RUN apt-get update && apt-get install -y \
        git \
        libolm-dev \
        python-pip \
        && rm -rf /var/lib/apt/lists/*

RUN python -m pip install --upgrade pip

RUN git clone https://github.com/poljar/weechat-matrix.git

WORKDIR weechat-matrix

ENV PATH="/root/.local/bin:${PATH}"

# python -m pip install -r requirements.txt
# results in errors
error
root@6af3facdaee6:/weechat-matrix# python -m pip install -r requirements.txt 
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pyOpenSSL (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl (53kB)
    100% |################################| 61kB 459kB/s 
Collecting typing (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/cc/3e/29f92b7aeda5b078c86d14f550bf85cff809042e3429ace7af6193c3bc9f/typing-3.6.6-py2-none-any.whl
Collecting webcolors (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/1d/44/c4902683be73beba20afd299705e11f0a753a01cc7f9d6a070841848605b/webcolors-1.8.1-py2.py3-none-any.whl
Collecting future (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz (829kB)
    100% |################################| 829kB 2.0MB/s 
Collecting atomicwrites (from -r requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/52/90/6155aa926f43f2b2a22b01be7241be3bfd1ceaf7d0b3267213e8127d41f4/atomicwrites-1.3.0-py2.py3-none-any.whl
Collecting attrs (from -r requirements.txt (line 6))
  Downloading https://files.pythonhosted.org/packages/23/96/d828354fa2dbdf216eaa7b7de0db692f12c234f7ef888cc14980ef40d1d2/attrs-19.1.0-py2.py3-none-any.whl
Collecting logbook (from -r requirements.txt (line 7))
  Downloading https://files.pythonhosted.org/packages/f6/83/20fc0270614919cb799f76e32cf143a54c58ce2fa45c19fd38ac2e4f9977/Logbook-1.4.3.tar.gz (85kB)
    100% |################################| 92kB 2.7MB/s 
Collecting pygments (from -r requirements.txt (line 8))
  Downloading https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl (849kB)
    100% |################################| 849kB 3.4MB/s 
Collecting matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0 from git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0 (from -r requirements.txt (line 9))
  Cloning https://github.com/poljar/matrix-nio.git (to revision master) to /tmp/pip-install-5UL9Sk/matrix-nio
Collecting cryptography>=2.3 (from pyOpenSSL->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/c3/c1/cf8665c955c9393e9ff0872ba6cd3dc6f46ef915e94afcf6e0410508ca69/cryptography-2.6.1-cp27-cp27mu-manylinux1_x86_64.whl (2.3MB)
    100% |################################| 2.3MB 14.9MB/s 
Requirement already satisfied: six>=1.5.2 in /usr/lib/python2.7/dist-packages (from pyOpenSSL->-r requirements.txt (line 1)) (1.11.0)
Collecting h11 (from matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/f9/f3/8e4cf5fa1a3d8bda942a0b1cf92f87815494216fd439f82eb99073141ba0/h11-0.8.1-py2.py3-none-any.whl (55kB)
    100% |################################| 61kB 3.9MB/s 
Collecting h2 (from matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/a6/b2/0348a08cce9980b15ef8607adc7f0534193fe25b9269daa0c327dc74f026/h2-3.1.0-py2.py3-none-any.whl (64kB)
    100% |################################| 71kB 4.3MB/s 
Collecting jsonschema (from matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/aa/69/df679dfbdd051568b53c38ec8152a3ab6bc533434fc7ed11ab034bf5e82f/jsonschema-3.0.1-py2.py3-none-any.whl (54kB)
    100% |################################| 61kB 7.0MB/s 
Collecting peewee (from matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/c9/e4/f82bd273a7c88e7a2f71652324039c7e382f2f88eced01b9799d6c936ad2/peewee-3.9.3.tar.gz (2.2MB)
    100% |################################| 2.2MB 2.1MB/s 
Collecting pycryptodome (from matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/41/80/216cd888906de20916c384d4345dd12fa4c475acd6b25af3f38449f727d5/pycryptodome-3.8.1-cp27-cp27mu-manylinux1_x86_64.whl (9.7MB)
    100% |################################| 9.7MB 427kB/s 
Collecting python-olm-dev (from matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/c1/37/02af98ce04dcfe473e5714703b4d5b1e4e77806a1c412c6c346310e132ac/python-olm-dev-3.0.tar.gz (238kB)
    100% |################################| 245kB 3.6MB/s 
Collecting unpaddedbase64 (from matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/d9/ee/6eff0c493c4cab61f17dfa65c058d1e8d2bf4ce33f44e1bc5c4834479dbc/unpaddedbase64-1.1.0-py2-none-any.whl
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/lib/python2.7/dist-packages (from cryptography>=2.3->pyOpenSSL->-r requirements.txt (line 1)) (0.24.0)
Requirement already satisfied: enum34; python_version < "3" in /usr/lib/python2.7/dist-packages (from cryptography>=2.3->pyOpenSSL->-r requirements.txt (line 1)) (1.1.6)
Requirement already satisfied: ipaddress; python_version < "3" in /usr/lib/python2.7/dist-packages (from cryptography>=2.3->pyOpenSSL->-r requirements.txt (line 1)) (1.0.17)
Collecting cffi!=1.11.3,>=1.8 (from cryptography>=2.3->pyOpenSSL->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/9d/6f/aea9f5559fb593da07ff34e67513bd62483b45715b4a5f5fae6a0a5792ea/cffi-1.12.2-cp27-cp27mu-manylinux1_x86_64.whl (413kB)
    100% |################################| 419kB 8.3MB/s 
Collecting hyperframe<6,>=5.2.0 (from h2->matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/19/0c/bf88182bcb5dce3094e2f3e4fe20db28a9928cb7bd5b08024030e4b140db/hyperframe-5.2.0-py2.py3-none-any.whl
Collecting hpack<4,>=2.3 (from h2->matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/8a/cc/e53517f4a1e13f74776ca93271caef378dadec14d71c61c949d759d3db69/hpack-3.0.0-py2.py3-none-any.whl
Collecting pyrsistent>=0.14.0 (from jsonschema->matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/8c/46/4e93ab8a379d7efe93f20a0fb8a27bdfe88942cc954ab0210c3164e783e0/pyrsistent-0.14.11.tar.gz (104kB)
    100% |################################| 112kB 2.2MB/s 
Collecting functools32; python_version < "3" (from jsonschema->matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/c5/60/6ac26ad05857c601308d8fb9e87fa36d0ebf889423f47c3502ef034365db/functools32-3.2.3-2.tar.gz
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from jsonschema->matrix-nio@ git+https://github.com/poljar/matrix-nio.git@master#egg=matrix-nio-0->-r requirements.txt (line 9)) (39.0.1)
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography>=2.3->pyOpenSSL->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
    100% |################################| 163kB 8.4MB/s 
Building wheels for collected packages: future, logbook, matrix-nio, peewee, python-olm-dev, pyrsistent, functools32, pycparser
  Building wheel for future (setup.py) ... done
  Stored in directory: /root/.cache/pip/wheels/0c/61/d2/d6b7317325828fbb39ee6ad559dbe4664d0896da4721bf379e
  Building wheel for logbook (setup.py) ... done
  Stored in directory: /root/.cache/pip/wheels/a2/9f/6f/8c7a4ed6b9f6f3c98b742dbb0fd41fff3c130119c507376301
  Building wheel for matrix-nio (setup.py) ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-W69Qd_/wheels/05/35/77/9f7b8b779bc2cddf53647d8d68ef5f8c7731dbc30973e4df92
  Building wheel for peewee (setup.py) ... done
  Stored in directory: /root/.cache/pip/wheels/05/a3/fd/4753289244f7b40745f016555a95ba4529f11aecadf64c77f0
  Building wheel for python-olm-dev (setup.py) ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5UL9Sk/python-olm-dev/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-5zRBrC --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/olm
  copying olm/utility.py -> build/lib.linux-x86_64-2.7/olm
  copying olm/group_session.py -> build/lib.linux-x86_64-2.7/olm
  copying olm/__version__.py -> build/lib.linux-x86_64-2.7/olm
  copying olm/pk.py -> build/lib.linux-x86_64-2.7/olm
  copying olm/account.py -> build/lib.linux-x86_64-2.7/olm
  copying olm/_compat.py -> build/lib.linux-x86_64-2.7/olm
  copying olm/session.py -> build/lib.linux-x86_64-2.7/olm
  copying olm/_finalize.py -> build/lib.linux-x86_64-2.7/olm
  copying olm/__init__.py -> build/lib.linux-x86_64-2.7/olm
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-2.7/_libolm.c'
  creating build/temp.linux-x86_64-2.7
  building '_libolm' extension
  creating build/temp.linux-x86_64-2.7/build
  creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_libolm.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_libolm.o
  build/temp.linux-x86_64-2.7/_libolm.c:496:18: fatal error: olm/pk.h: No such file or directory
           #include <olm/pk.h>
                    ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for python-olm-dev
  Running setup.py clean for python-olm-dev
  Building wheel for pyrsistent (setup.py) ... done
  Stored in directory: /root/.cache/pip/wheels/83/59/9a/a037b9b3c3e93d9275ea0aff9d6064400f372879dfdab01afe
  Building wheel for functools32 (setup.py) ... done
  Stored in directory: /root/.cache/pip/wheels/b5/18/32/77a1030457155606ba5e3ec3a8a57132b1a04b1c4f765177b2
  Building wheel for pycparser (setup.py) ... done
  Stored in directory: /root/.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
Successfully built future logbook matrix-nio peewee pyrsistent functools32 pycparser
Failed to build python-olm-dev
Installing collected packages: pycparser, cffi, cryptography, pyOpenSSL, typing, webcolors, future, atomicwrites, attrs, logbook, pygments, h11, hyperframe, hpack, h2, pyrsistent, functools32, jsonschema, peewee, pycryptodome, python-olm-dev, unpaddedbase64, matrix-nio
  Found existing installation: cryptography 2.1.4
    Uninstalling cryptography-2.1.4:
      Successfully uninstalled cryptography-2.1.4
  Running setup.py install for python-olm-dev ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5UL9Sk/python-olm-dev/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-yP8qBd/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/olm
    copying olm/utility.py -> build/lib.linux-x86_64-2.7/olm
    copying olm/group_session.py -> build/lib.linux-x86_64-2.7/olm
    copying olm/__version__.py -> build/lib.linux-x86_64-2.7/olm
    copying olm/pk.py -> build/lib.linux-x86_64-2.7/olm
    copying olm/account.py -> build/lib.linux-x86_64-2.7/olm
    copying olm/_compat.py -> build/lib.linux-x86_64-2.7/olm
    copying olm/session.py -> build/lib.linux-x86_64-2.7/olm
    copying olm/_finalize.py -> build/lib.linux-x86_64-2.7/olm
    copying olm/__init__.py -> build/lib.linux-x86_64-2.7/olm
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-2.7/_libolm.c'
    creating build/temp.linux-x86_64-2.7
    building '_libolm' extension
    creating build/temp.linux-x86_64-2.7/build
    creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_libolm.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_libolm.o
    build/temp.linux-x86_64-2.7/_libolm.c:496:18: fatal error: olm/pk.h: No such file or directory
             #include <olm/pk.h>
                      ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5UL9Sk/python-olm-dev/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-yP8qBd/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-5UL9Sk/python-olm-dev/

Errors upon connecting - olm issue?

Upon connecting and logging in (not all rooms gets loaded, but about 22 do) I get the following errors in Weechat. I'm a unsure what the cause is, but the result seems to be that Olm doesn't work.

matrix: Logging in...
python: stdout/stderr (colorize_nicks): Traceback (most recent call last):
python: stdout/stderr (matrix): Traceback (most recent call last):
python: stdout/stderr (colorize_nicks):   File "$HOME/.weechat/python/matrix/utf.py", line 91, in wrapper
python: stdout/stderr (matrix):   File "$HOME/.weechat/python/matrix/utf.py", line 91, in wrapper
python: stdout/stderr (colorize_nicks):     return function(*decode_from_utf8(args), **decode_from_utf8(kwargs))
python: stdout/stderr (matrix):     return function(*decode_from_utf8(args), **decode_from_utf8(kwargs))
python: stdout/stderr (colorize_nicks):   File "$HOME/.weechat/python/matrix.py", line 308, in receive_cb
python: stdout/stderr (matrix):   File "$HOME/.weechat/python/matrix.py", line 308, in receive_cb
python: stdout/stderr (colorize_nicks):     response = server.client.next_response(MAX_EVENTS)
python: stdout/stderr (matrix):     response = server.client.next_response(MAX_EVENTS)
python: stdout/stderr (colorize_nicks):   File "$HOME/.local/lib/python2.7/site-packages/nio/client.py", line 1403, in
                 ╡ next_response
python: stdout/stderr (matrix):   File "$HOME/.local/lib/python2.7/site-packages/nio/client.py", line 1403, in next_response
python: stdout/stderr (colorize_nicks):     self.receive_response(response)
python: stdout/stderr (matrix):     self.receive_response(response)
python: stdout/stderr (matrix):     self.receive_response(response)
python: stdout/stderr (colorize_nicks):   File "$HOME/.local/lib/python2.7/site-packages/nio/client.py", line 636, in
                 ╡ receive_response
python: stdout/stderr (matrix):   File "$HOME/.local/lib/python2.7/site-packages/nio/client.py", line 636, in
                 ╡ receive_response
python: stdout/stderr (colorize_nicks):     self._handle_login(response)
python: stdout/stderr (matrix):     self._handle_login(response)
python: stdout/stderr (colorize_nicks):   File "$HOME/.local/lib/python2.7/site-packages/nio/client.py", line 466, in
                 ╡ _handle_login
python: stdout/stderr (matrix):   File "$HOME/.local/lib/python2.7/site-packages/nio/client.py", line 466, in _handle_login
python: stdout/stderr (colorize_nicks):     self.load_store()                                                                 
python: stdout/stderr (matrix):     self.load_store()        
python: stdout/stderr (colorize_nicks):   File "$HOME/.local/lib/python2.7/site-packages/nio/client.py", line 317, in
                 ╡ load_store
python: stdout/stderr (matrix):   File "$HOME/.local/lib/python2.7/site-packages/nio/client.py", line 317, in load_store
python: stdout/stderr (colorize_nicks):     self.olm = Olm(self.user_id, self.device_id, self.store)                       
python: stdout/stderr (matrix):     self.olm = Olm(self.user_id, self.device_id, self.store)        
python: stdout/stderr (colorize_nicks):   File "$HOME/.local/lib/python2.7/site-packages/nio/crypto/olm_machine.py", line
                 ╡ 140, in __init__
python: stdout/stderr (matrix):   File "$HOME/.local/lib/python2.7/site-packages/nio/crypto/olm_machine.py", line 140, in
                 ╡ __init__
python: stdout/stderr (colorize_nicks):     self.account = OlmAccount()
python: stdout/stderr (matrix):     self.account = OlmAccount()
python: stdout/stderr (colorize_nicks):   File "$HOME/.local/lib/python2.7/site-packages/nio/crypto/sessions.py", line 33, in
                 ╡ __new__
python: stdout/stderr (matrix):   File "$HOME/.local/lib/python2.7/site-packages/nio/crypto/sessions.py", line 33, in __new__
python: stdout/stderr (colorize_nicks):     return super().__new__(cls)
python: stdout/stderr (matrix):     return super().__new__(cls)
python: stdout/stderr (colorize_nicks):   File
                 ╡ "/usr/local/lib/python2.7/site-packages/python_olm-3.0.0-py2.7-openbsd-6.4-amd64.egg/olm/account.py", line 63, in __new__
python: stdout/stderr (matrix):   File
                 ╡ "/usr/local/lib/python2.7/site-packages/python_olm-3.0.0-py2.7-openbsd-6.4-amd64.egg/olm/account.py", line 63, in __new__
python: stdout/stderr (colorize_nicks):     obj._buf = ffi.new("char[]", lib.olm_account_size())
python: stdout/stderr (matrix):     obj._buf = ffi.new("char[]", lib.olm_account_size())
python: stdout/stderr (colorize_nicks): AttributeError: cffi library '_libolm' has no function, constant or global variable
                 ╡ named 'olm_account_size'
python: stdout/stderr (matrix): AttributeError: cffi library '_libolm' has no function, constant or global variable named
                 ╡ 'olm_account_size'
2113  weechat  ⚠ ╡ python: error in function "receive_cb"

Chat History/Scrollback

/window scroll_up does not reveal all of the chat history.
Is there a specific command for this or is it missing functionality?

Error with command 'matrix_upload'

I have the matrix_upload script set up as instructed, including having it on my path, but if I do "/upload /home/user/test.png" (test.png is a screenshot I took with scrot) in a room, I get the output "Error with command 'matrix_upload'" in the weechat buffer. I am able to use matrix_upload directly from the terminal; it just doesn't work in weechat.

I'm not sure how to get a more detailed error description. Let me know if this is needed.

[error] AttributeError: 'NoneType' object has no attribute 'get_binary_type

Hi all

I have a fresh install (master branch) on a weechat 2.4 shipped with python 2.7.
The /matrix connect matrix_org command returns this error:
Any thought ?

Thanks

12:54 -- freenode-connect (frigg@freenode/utility-bot/frigg): Welcome to freenode. To protect the network all new connections will be scanned for vulnerabilities. This will not harm your computer, and vulnerable hosts will be notified.
12:54 -- CTCP requested by freenode-connect: VERSION (blocked)
12:54 -- #security: ##security :Forwarding to another channel
12:54 python: loading script "/home/parisni/.weechat/python/matrix.py"
12:54 python: registered script "matrix", version 0.1 (matrix chat plugin)
12:54 -- matrix: Connecting to matrix.org:443 (SSL)...
12:54 -- matrix: Doing SSL handshake...
12:54 -- matrix: Connected using TLSv1.3, and 256 bit TLS_AES_256_GCM_SHA384 cipher suite.
12:54 -- matrix: received certificate
12:54  - certificate info:
12:54     - subject: commonName=www.matrix.org, serial number
12:54         03F40B355432D2DC89D5506299C1DE90418C
12:54     - issuer: countryName=US, organizationName=Let's Encrypt,
12:54         commonName=Let's Encrypt Authority X3
12:54     - key info: RSA key 4096 bits, signed using
12:54         sha256WithRSAEncryption
12:54     - period of validity:
12:54         Begins on:  Apr 11 10:43:45 2019 GMT
12:54         Expires on: Jul 10 10:43:45 2019 GMT
12:54     - fingerprints:
12:54         SHA1:   56:94:4A:54:90:66:A9:98:97:B1:DE:35:56:6E:E4:CE:D6:B4:94:81
12:54         SHA256: 3E:AD:E4:5B:89:F6:4A:D1:67:38:5B:40:D0:F4:E2:5C:89:34:1D:91:7A:8F:02:F2:47:CB:4C:95:A4:64:A3:A2
12:54 -- matrix: Logging in...
12:54 python: stdout/stderr (matrix): Traceback (most recent call last):
12:54 python: stdout/stderr (matrix):   File "/home/parisni/.weechat/python/matrix/utf.py", line 91, in wrapper
12:54 python: stdout/stderr (matrix):     return function(*decode_from_utf8(args), **decode_from_utf8(kwargs))
12:54 python: stdout/stderr (matrix):   File "/home/parisni/.weechat/python/matrix.py", line 309, in receive_cb
12:54 python: stdout/stderr (matrix):     response = server.client.next_response(MAX_EVENTS)
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/nio/client/http_client.py", line 826, in next_response
12:54 python: stdout/stderr (matrix):     self.receive_response(response)
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/nio/client/base_client.py", line 610, in receive_response
12:54 python: stdout/stderr (matrix):     self._handle_login(response)
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/nio/client/base_client.py", line 401, in _handle_login
12:54 python: stdout/stderr (matrix):     self.load_store()
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/nio/client/base_client.py", line 248, in load_store
12:54 python: stdout/stderr (matrix):     self.config.store_name
12:54 python: stdout/stderr (matrix):   File "<attrs generated init 5f027665cfdf70b24c9883f3edf2cdb2800261b7>", line 7, in __init__
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/nio/store/database.py", line 872, in __attrs_post_init__
12:54 python: stdout/stderr (matrix):     super().__attrs_post_init__()
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/nio/store/database.py", line 533, in __attrs_post_init__
12:54 python: stdout/stderr (matrix):     self.database.create_tables(self.models)
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/peewee.py", line 5829, in __exit__
12:54 python: stdout/stderr (matrix):     model.bind(db, self.bind_refs, self.bind_backrefs)
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/peewee.py", line 6175, in bind
12:54 python: stdout/stderr (matrix):     cls._meta.set_database(database)
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/peewee.py", line 5667, in set_database
12:54 python: stdout/stderr (matrix):     hook(database)
12:54 python: stdout/stderr (matrix):   File "/home/parisni/git/weechat-matrix/venv2/lib/python2.7/site-packages/peewee.py", line 4422, in _db_hook
12:54 python: stdout/stderr (matrix):     self._constructor = database.get_binary_type()
12:54 python: stdout/stderr (matrix): AttributeError: 'NoneType' object has no attribute 'get_binary_type'
12:54:35    weechat =!= | python: error in function "receive_cb"

Can't switch to buffers by name

I'm used to using the /buffer <name> command with the weechat lua script to switch to particular buffers (since I have well over 100 of them). I noticed that while the weechat shortname for my buffers is correct, weechat is using the room ID as the key to complete the /buffer command (server.!roomid:server.com). Is there a weechat setting that will make the /buffer command evaluate short names for completion/buffer switching or is there some other way I should be switching directly to buffers with your script?

Unable to load, libolm.so.2 not found

I am unable to load the matrix plugin in weechat, here's the backtrace in weechat after executing /script load matrix.py:

python: loading script "/home/clayton/.weechat/python/autoload/matrix.py"python: stdout/stderr (?): Traceback (most recent call last):
python: stdout/stderr (?):   File "/home/clayton/.weechat/python/autoload/matrix.py", line 34, in <module>
python: stdout/stderr (?):     from nio import RemoteProtocolError, RemoteTransportError, TransportType
python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/nio/__init__.py", line 2, in <module>
python: stdout/stderr (?):     from .client import HttpClient, TransportType, Client
python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/nio/client.py", line 48, in <module>
python: stdout/stderr (?):     from .crypto import DeviceStore, Olm
python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/nio/crypto/__init__.py", line 1, in <module>
python: stdout/stderr (?):     from .sessions import (
python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/nio/crypto/sessions.py", line 18, in <module>
python: stdout/stderr (?):     import olm
python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/olm/__init__.py", line 12, in <module>
python: stdout/stderr (?):     from .utility import ed25519_verify, OlmVerifyError
python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/olm/utility.py", line 25, in <module>
python: stdout/stderr (?):     from _libolm import ffi, lib  # type: ignore
python: stdout/stderr (?): ImportError: libolm.so.2: cannot open shared object file: No such file or directory
python: unable to parse file "/home/clayton/.weechat/python/autoload/matrix.py"

I have installed libolm from AUR, as instructed in the README, and I'm using the master branch of weechat-matrix (last fetched a few hours ago). libolm in AUR does not provide libolm.so.2:

❯ pacman -Ql libolm                                                                                      i
libolm /usr/
libolm /usr/include/
libolm /usr/include/olm/
libolm /usr/include/olm/inbound_group_session.h
libolm /usr/include/olm/olm.h
libolm /usr/include/olm/outbound_group_session.h
libolm /usr/include/olm/pk.h
libolm /usr/lib/
libolm /usr/lib/libolm.so
libolm /usr/lib/libolm.so.3
libolm /usr/lib/libolm.so.3.0.0

Redact command improvement.

The redact command uses the line number to choose which event to redact, since line numbers constantly change when receiving new events this can lead to a race condition and the user redacting the wrong event.

The completion should be changed to present the user with event ids instead of line numbers and the command callback should accept event ids.

Improve /help matrix

Improve the output of /help matrix to mention all available commands (i.e. /devices, /olm, /redact, /room), not just those currently available under /matrix.

There are also a bunch of overriden standard commands like /invite, /me, /join, /kick, /topic that could also be mentioned so users know that they work.

HTTP/1.1 connection close shouldn't be considered as server disconnect

It is somehow related to issue described in #27

Since synapse recommended configuration now include reverse proxy to handle SSL for clients, many of reverse proxy configurations include idle timeout and max number of request allowed to make during a single HTTP/1.1 session. Example is here.

Since Matrix is HTTP-based protocol, not connection based protocol, closed connection should not really be treated as server disconnect and reopened silently, and I guess use of matrix-nio actually an advantage in this case since matrix-nio doesn't handle connection by itself.

FlowControlError in larger rooms

I'm using nginx in front of Synapse with the http2 module. Config is as default as it can get.

server {
ssl on;
ssl_certificate [...];
ssl_certificate_key [...];

listen 1234 ssl http2;
listen [::]:1234 ssl http2;

Everything seems to work fine, except when posting to rooms with more than 30 participants. It seems to be an issue with the allowed data size somewhere. weechat-matrix outputs this nicely like follows, but is this a setting that is changed on the server or the client?

 python: stdout/stderr (matrix): h2.exceptions.FlowControlError: Cannot send 86311 bytes, flow control window is 65536.

Command UX improvements

The current Matrix-specific command UX could be improved somewhat.

Some ideas:

  1. All commands supported under Matrix could be aliased as /matrix COMMAND while also retaining their shorter, global versions (e.g. you could use both /devices and /matrix devices). This would improve usability and consistency.

  2. Some commands like /matrix connect|reconnect|disconnect are only available under /matrix. It would be better if /connect and the rest were hooked so you could just type /connect matrix_server and have everything work seamlessly, like with IRC.

    This could be implemented by hooking the /connect command using hook_command_run() and checking whether the current buffer is a matrix buffer (or the target server is a Matrix server, but see below[*]). If not, just pass control back to weechat which would then execute the standard command.
    [*] This might be problematic because you can have an IRC server defined with the same name. We'd have to check whether this is the case and handle it accordingly.

    It would also be great if you could type /help matrix connect instead of /matrix help connect; not sure whether this is possible.

  3. The /olm command itself should probably be restructured.

    • Make /olm info display your own keys. Ditch /olm info private.
    • Make /olm list display all keys (for consistency with /devices list). Ditch /olm list all (it then being the default behaviour).
  4. /olm should probably be available as /matrix key (or keys) to be more intuitive. /key is out of the question because it clashes with weechat's standard command for keybindings, so perhaps keys is best. Plural would also be consistent with /devices.

Whatsapp bridge display names

I'm using https://github.com/tulir/mautrix-whatsapp and while the lua plugin shows somewhat readable whatsapp user names, this python plugin shows whatsapp_$phonenr (for AS user @whatsapp_$phonenr:example.com). Apparently there is already some fix for IRC and more work underway in #28

This probably also depends on the AS registration config.

crash on invalid utf8

15:30:07     | python: unloading script "matrix"
15:30:08     | python: stdout/stderr (matrix): Traceback (most recent call last):
15:30:08     | python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix.py", line 489, in buffer_switch_cb
15:30:08     | python: stdout/stderr (matrix):     if room_buffer.should_send_read_marker:
15:30:08     | python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/buffer.py", line 919, in should_send_read_marker
15:30:08     | python: stdout/stderr (matrix):
15:30:08     | python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/buffer.py", line 947, in read_markers_enabled
15:30:08     | python: stdout/stderr (matrix):     @property
15:30:08     | python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/config.py", line 354, in str_getter
15:30:08     | python: stdout/stderr (matrix):     return W.config_string(self._option_ptrs[name])
15:30:08     | python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/utf.py", line 56, in hooked
15:30:08     | python: stdout/stderr (matrix):     return decode_from_utf8(result)
15:30:08     | python: stdout/stderr (matrix):   File "/home/matthew/.weechat/python/matrix/utf.py", line 98, in decode_from_utf8
15:30:08     | python: stdout/stderr (matrix):     return data.decode("utf-8")
15:30:08     | python: stdout/stderr (matrix):   File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
15:30:08     | python: stdout/stderr (matrix):     return codecs.utf_8_decode(input, errors, True)
15:30:08     | python: stdout/stderr (matrix): UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 0: invalid continuation byte
15:30:08 =!= | python: error in function "buffer_switch_cb"
15:30:09     | python: script "matrix" unloaded

Handle bans.

Bans are currently ignored, the user is left in the nicklist and no message is printed out.

The handle_membership_events() method in of RoomBuffer in buffer.py should be extended to handle bans.

Feature request: Send messages to unverified devices

If you send a message in Riot without having verified all the devices in the room, you get a warning/prompt which allows you to send the message anyway. The people you haven't verified will still be able to decrypt your message.

It would be nice to have this functionality available, since I don't want to verify a device before I have a secure way of doing so, but I'd still like to send (less secure) messages before I do so.

Error while sending encrypted messages

I was able to send 1 encrypted message, but then after that, I get the following error while trying to:

weechat     | python: stdout/stderr (matrix): Traceback (most recent call last):
weechat     | python: stdout/stderr (matrix):   File "/home/user/.weechat/python/matrix/utf.py", line 91, in wrapper
weechat     | python: stdout/stderr (matrix):     return function(*decode_from_utf8(args), **decode_from_utf8(kwargs))
weechat     | python: stdout/stderr (matrix):   File "/home/user/.weechat/python/matrix.py", line 318, in receive_cb
weechat     | python: stdout/stderr (matrix):     server.handle_response(response)
weechat     | python: stdout/stderr (matrix):   File "/home/user/.weechat/python/matrix/server.py", line 1420, in handle_response
weechat     | python: stdout/stderr (matrix):     self.encryption_queue[room_id].appendleft(message)
weechat     | python: stdout/stderr (matrix): UnboundLocalError: local variable 'message' referenced before assignment
weechat =!= | python: error in function "receive_cb"

/script load matrix.py fails on Arch

I get this but it's not clear what file is missing:

     │14:20:20 weechat     | python: loading script "/home/sam/.weechat/python/matrix.py"
     │14:20:20 weechat     | python: stdout/stderr (?): Traceback (most recent call last):
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/home/sam/.weechat/python/matrix.py", line 34, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):     from nio import RemoteProtocolError, RemoteTransportError, TransportType
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/home/sam/.local/lib/python2.7/site-packages/matrix_nio-0.1-py2.7.egg/nio/__init__.py", line 2, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):     from .client import HttpClient, TransportType, Client
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/home/sam/.local/lib/python2.7/site-packages/matrix_nio-0.1-py2.7.egg/nio/client.py", line 46, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):     from .crypto import Olm
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/home/sam/.local/lib/python2.7/site-packages/matrix_nio-0.1-py2.7.egg/nio/crypto/__init__.py", line 19, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):     from .olm_machine import Olm  
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/home/sam/.local/lib/python2.7/site-packages/matrix_nio-0.1-py2.7.egg/nio/crypto/olm_machine.py", line 40, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):     from jsonschema import SchemaError, ValidationError
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/home/sam/.local/lib/python2.7/site-packages/jsonschema-3.0.1-py2.7.egg/jsonschema/__init__.py", line 22, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):     from jsonschema._types import TypeChecker
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/home/sam/.local/lib/python2.7/site-packages/jsonschema-3.0.1-py2.7.egg/jsonschema/_types.py", line 3, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):     from pyrsistent import pmap
     │14:20:20 weechat     | python: stdout/stderr (?):   File "build/bdist.linux-x86_64/egg/pyrsistent/__init__.py", line 3, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):   File "build/bdist.linux-x86_64/egg/pyrsistent/_pmap.py", line 4, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):   File "build/bdist.linux-x86_64/egg/pyrsistent/_pvector.py", line 699, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):   File "build/bdist.linux-x86_64/egg/pvectorc.py", line 7, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):   File "build/bdist.linux-x86_64/egg/pvectorc.py", line 3, in __bootstrap__
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3191, in <module>
     │14:20:20 weechat     | python: stdout/stderr (?):     @_call_aside
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3175, in _call_aside
     │14:20:20 weechat     | python: stdout/stderr (?):     f(*args, **kwargs)
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
     │14:20:20 weechat     | python: stdout/stderr (?):     working_set = WorkingSet._build_master()
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 574, in _build_master
     │14:20:20 weechat     | python: stdout/stderr (?):     ws = cls()
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 567, in __init__
     │14:20:20 weechat     | python: stdout/stderr (?):     self.add_entry(entry)
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 623, in add_entry
     │14:20:20 weechat     | python: stdout/stderr (?):     for dist in find_distributions(entry, True):
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2007, in find_on_path
     │14:20:20 weechat     | python: stdout/stderr (?):     path_item = _normalize_cached(path_item)
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2317, in _normalize_cached
     │14:20:20 weechat     | python: stdout/stderr (?):     _cache[filename] = result = normalize_path(filename)
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2299, in normalize_path
     │14:20:20 weechat     | python: stdout/stderr (?):     return os.path.normcase(os.path.realpath(os.path.normpath(_cygwin_patch(filename))))
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/posixpath.py", line 383, in realpath
     │14:20:20 weechat     | python: stdout/stderr (?):     return abspath(path)
     │14:20:20 weechat     | python: stdout/stderr (?):   File "/usr/lib/python2.7/posixpath.py", line 371, in abspath
     │14:20:20 weechat     | python: stdout/stderr (?):     cwd = os.getcwd()
     │14:20:20 weechat     | python: stdout/stderr (?): OSError: [Errno 2] No such file or directory
     │14:20:20 weechat =!= | python: unable to parse file "/home/sam/.weechat/python/matrix.py"
     │14:20:51 weechat     | python: 2.7.15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.