!JiiOHXrIUCtcOJsZCa:matrix.org

nio

304 Members
The nio matrix python library | Latest release 0.20.0 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/129 Servers

Load older messages


SenderMessageTime
24 Sep 2022
@drrac27:matrix.orgDrRac27 joined the room.11:59:36
@drrac27:matrix.orgDrRac27
In reply to @ma_person:cuteworld.space
Is there an event for reactions, I mean for example if someone gives a thumps up to a post, how can that be detected?

I created a PR for it: #351. You may want to check it out and maybe give feedback so it can be merged sooner?

12:19:00
27 Sep 2022
@christianp:vector.modular.imChristianPAll examples seem to use `await client.sync_forever(...)`. Are there functions to start and stop the sync in a separate thread? 07:23:09
@tulir:maunium.nettulirmixing threads with asyncio is generally not a good idea07:24:41
@tulir:maunium.nettulir if you mean start in the background in the same thread, asyncio.create_task(...) can be used instead of await ... 07:25:04
@tulir:maunium.nettulir(but you may need a wrapper function to catch and handle/log errors if the function doesn't do it automatically, anything bubbling up to the create_task level will be dropped silently)07:26:14
@ff777:nerdsin.spaceFF777yeah i had to deal with that.... errors not showing up when i run the thing as a task07:36:33
@ff777:nerdsin.spaceFF777 i don't even remember how i solved it... maybe with the asyncio.gather method.... i'm not very good at python, i just kind of trial & error a lot until some thing works.. 07:37:59
@christianp:vector.modular.imChristianPThis is for a Home Assistant integration. If I await sync_forever(), most logic of Home Assistant freezes.07:55:46
@christianp:vector.modular.imChristianPI've tried hass.creat_task() without much success - the integration still does not seem to return to the main programm correctly. The idea of threads comes from the working Mateix integration that uses the matrix-client package. https://github.com/home-assistant/core/blob/cba3b6ad944408b9ffd906f4da5e5f5fd615b174/homeassistant/components/matrix/__init__.py#L18407:58:57
@tulir:maunium.nettulirthe legacy python sdk isn't asyncio, so using threads works fine there08:07:40
@tulir:maunium.nettulir did you try just using asyncio.create_task? hass.async_create_task seems more like it'll run in background, but still wait for all those tasks before finishing startup 08:11:25
@christianp:vector.modular.imChristianP I've tried hass.create_task() which also blocks Home Assistant.
Now trying asyncio.create_task for the first time...
08:19:29
@christianp:vector.modular.imChristianP asyncio.create_task works. πŸ₯³ 08:39:44
28 Sep 2022
@anobis:lclhst.orgnobiz joined the room.14:35:01
@anobis:lclhst.orgnobiz set a profile picture.14:43:21
@anobis:nolex.io@anobis:nolex.io left the room.14:47:19
@poljar:matrix.orgpoljar changed the room topic to "The nio matrix python library | Latest release 0.20.0 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/" from "The nio matrix python library | Latest release 0.18.3 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/".14:50:21
@rfe:matrix.orgMisha joined the room.18:42:09
29 Sep 2022
@optimization:matrix.orgValenchak joined the room.03:47:44
@doorbell_:matrix.orgdoorbell_Is it possible that the call events are not triggered?17:31:54
@doorbell_:matrix.orgdoorbell_I almost got webrtc working with NIO but I does not get any events in my callback related to the call. But other events like RoomMessageText does well go throug17:33:57
@lado:tchncs.de@lado:tchncs.de left the room.17:38:56
@doorbell_:matrix.orgdoorbell_

My setup of my callback looks like
gs.client.add_event_callback(
callbacks.message_callback,
(CallAnswerEvent,
RoomMessageText,
CallEvent,
CallInviteEvent,
CallCandidatesEvent,
CallHangupEvent)
)

And the callback itself like:
async def message_callback(self, room: MatrixRoom, event: Event):

    if room.room_id == ROOM_ID:
        print("Callback active")
        print(type(event))

        if isinstance(event, RoomMessageText):
            print(event.body)
        if isinstance(event, CallAnswerEvent):
            gs.rtcConnection.setRemoteDescription(event.answer["sdp"])
17:39:19
1 Oct 2022
@nik:matrix.teckids.orgNik | Klampfradler 🎸🚴🏻 changed their profile picture.07:34:25
@doorbell_:matrix.orgdoorbell_No one that can help me with this?08:09:38
@doorbell_:matrix.orgdoorbell_Redacted or Malformed Event09:08:08
@doorbell_:matrix.orgdoorbell_Found the issue in my situation. The events couldn't map to the event type. I fixed it in PR https://github.com/poljar/matrix-nio/pull/35509:59:20
3 Oct 2022
@imbev:matrix.orgimbev joined the room.21:16:18
@imbev:matrix.orgimbevare there any breaking changes from version 0.19.0 to 0.20.0 ?21:17:06

There are no newer messages yet.


Back to Room List