!JiiOHXrIUCtcOJsZCa:matrix.org

nio

166 Members
The nio matrix python library | Latest release 0.14.1 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/91 Servers

Load older messages


SenderMessageTime
2 Jul 2020
@olmari:hacklab.fiSami OlmariI still got same message on my chat on e2e room where bot sent message, after uploading keys (:17:30:33
@olmari:hacklab.fiSami Olmarifor testing I was not =P17:31:40
@alex:aceno.dealex.acenoUhh.. the next Django Version 3.1 which expected to arrive in August has full async support. That's great.17:37:30
@olmari:hacklab.fiSami Olmari
2020-07-02 20:52:50,869 ERROR    Matrixbot: VaasaHackBot: Couldn't send message to room "Test room E2E", got error:
	Device KXNUWSVEUC for user @olmari:hacklab.fi is not verified or blacklisted.

I bet I'll find some "don't care about verify" toggle from API :)

17:54:07
@olmari:hacklab.fiSami OlmariI thnk I hit some ratelimiting on sync_forever, as it seems to stop on some old message and not do anything but wait.. if I put some sleep inside the message callback handler everyhitng works (sans above separate thing).. That being said, how do I tell "yes I've read the history, so done about that", now it seems to catch same old mesasges every time 🙂18:01:53
@olmari:hacklab.fiSami OlmariFor this bot I need to first do sync without caring what has been said in history, then start follow stuff and react.. So I guess first full sync, and the some method to tell "I've read these", then sync forever18:03:48
@olmari:hacklab.fiSami Olmari since in sync expects what format? :) 18:13:15
@olmari:hacklab.fiSami OlmariI'd like it to behave exactly like "since = now" 18:18:18
@olmari:hacklab.fiSami OlmariDo I need to add some form of event callback for "sending message" when I use sync_forever? I mean otherwise it will be on sync loop... fwell.. forever =)18:33:23
@olmari:hacklab.fiSami OlmariI mean this bot needs to be able to talk things despite awaiting on sync_forever syncing forever =)18:39:29
@olmari:hacklab.fiSami Olmarioh well, still not the most important stuff to do right now on this bot, I'll get back to this in the future when rest of it is ready :)19:00:55
@poljar:matrix.orgpoljar a common technique to ignore old messages is to sync once and then to sync_forever() 19:43:15
@poljar:matrix.orgpoljar you can add event callbacks or you can put your sync_forever() into a asyncio task 19:43:41
@poljar:matrix.orgpoljar the room_send() method has a ignore_unverified_devices argument, that way you can send and ignore at the same time 19:44:36
@poljar:matrix.orgpoljarthe since argument takes a next_batch token of a previous sync response19:45:06
@olmari:hacklab.fiSami Olmariyeah, I'll need to try learn this stuff more and better :)20:03:20
3 Jul 2020
@olmari:hacklab.fiSami OlmariAside taskifying listening (aka implementing it at all), this is how I ended up making this, working nicely threading per bot and asyncio used withing nio... Propably plenty spots that I could functionize to make code more readable etc, but for the curious minds here it is https://github.com/vaasahacklab/gatekeeper/blob/python3/matrixbot.py14:27:30
@olmari:hacklab.fiSami OlmariOfcourse I could generate all sorts of prettier message contents etc, but that's another thing, code flow was the point now :)14:29:48
@olmari:hacklab.fiSami OlmariI know it currently misses some cornercases, depending are they needed or not in practice and how... For example if store folder is nuked for whatever reason, it will ofcourse make one, but it also will happily continue using config stored credentials if exist.. I don't know what restore_login does there.. or I mean it seemed to work too just fine, but I wonder if lost store data has anythign to do with anything login wise14:40:14
@olmari:hacklab.fiSami Olmariie "lost store folder" --> "do pw login again and save new details" is a thing or no14:40:39
@olmari:hacklab.fiSami OlmariI mean does it make any difference for store-wise do one do PW login or restores login, assuming empty store14:44:32
@olmari:hacklab.fiSami OlmariSure, empty store has other implications, taht's then different thing itself :)14:45:48
@poljar:matrix.orgpoljar there's no difference, it's the same thing, login() uses a password and makes a request, restore_login() uses the access token and doesn't need to make a request 14:46:01
@poljar:matrix.orgpoljarit comes down to do i want to store the access token or do i want to store the password14:46:38
@olmari:hacklab.fiSami OlmariGood to know, thus there is no point checking that thing specifically :)14:47:11
@henry:matrix.thetwelfth.comHenry joined the room.18:33:36
@henry:matrix.thetwelfth.comHenry

I am having trouble installing the package matrix-nio[e2e] using pip; I installed libolm with sudo apt install libolm3 but when I run pip3 install "matrix-nio[e2e]" I get,

ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3fkdrkli/python-olm/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3fkdrkli/python-olm/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-c2gxpwaa
       cwd: /tmp/pip-install-3fkdrkli/python-olm/
  Complete output (29 lines):
  make: *** No rule to make target '../include/olm/olm.h', needed by 'include/olm/olm.h'.  Stop.
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/olm
  copying olm/__init__.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/__version__.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/_compat.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/_finalize.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/account.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/group_session.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/pk.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/sas.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/session.py -> build/lib.linux-x86_64-3.8/olm
  copying olm/utility.py -> build/lib.linux-x86_64-3.8/olm
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-3.8/_libolm.c'
  creating build/temp.linux-x86_64-3.8
  building '_libolm' extension
  creating build/temp.linux-x86_64-3.8/build
  creating build/temp.linux-x86_64-3.8/build/temp.linux-x86_64-3.8
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c build/temp.linux-x86_64-3.8/_libolm.c -o build/temp.linux-x86_64-3.8/build/temp.linux-x86_64-3.8/_libolm.o -I../include
  build/temp.linux-x86_64-3.8/_libolm.c:541:18: fatal error: olm/olm.h: No such file or directory
    541 |         #include <olm/olm.h>
        |                  ^~~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for python-olm
18:37:05
@miruka:privacytools.iomiruka*install libolm-dev from apt18:41:11
@henry:matrix.thetwelfth.comHenryThanks, that worked18:44:27
4 Jul 2020
@richard:perthchat.orgrichard 08:59:00

There are no newer messages yet.


Back to Room List