250 Members
The nio matrix python library | Latest release 0.18.3 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/119 Servers

Load older messages

19 Oct 2021

theoretically, nio could infer that from the fully qualified user ID, but looking at the code here nio does not do that https://matrix-nio.readthedocs.io/en/latest/_modules/nio/api.html?highlight=register#


although, looking by the return value, it is not supposed to be called on its' own, but more like generating an input to aother function that actually does the request

@houkime:m.wfr.moehoukimewhat function it is supposed to be used with?15:47:17
@houkime:m.wfr.moehoukimeok, i guess just regular python request will do. whateber15:53:38

basically, it is just other methods of this family are stating that they are request data generators and register() for some reason omitted 'Returns the HTTP method, HTTP path and data for the request.' string in the doc

@krazykirby99999:matrix.orgkrazykirby99999 "The fully qualified user ID" 15:56:38
@krazykirby99999:matrix.orgkrazykirby99999that means that the homeserver is included as part of the user id unless i am mistaken15:57:09
@houkime:m.wfr.moehoukimeit means, i have noted above that nio could infer that. But it does not do this because this function is supposed to just generate a path and data for a request (so it is code that is calling this function that is supposed to know a server)15:59:08
@krazykirby99999:matrix.orgkrazykirby99999 it returns a tuple return "POST", path, Api.to_json(content_dict) 16:00:11
@krazykirby99999:matrix.orgkrazykirby99999perhaps you are expected to make the request yourself?16:00:23

yes, that's what i stated.

@houkime:m.wfr.moehoukimewill try now16:01:22
@houkime:m.wfr.moehoukime(small local conduit server)16:01:33
In reply to@tulir:maunium.net
I think the whoami endpoint returns the device ID nowadays (but keep in mind that encryption won't work if another client already set up keys with that token/ID)
it only returns the user id, not the device id
In reply to @krazykirby99999:matrix.org
it only returns the user id, not the device id
no, it returns both
@tulir:maunium.nettulir(but I said "nowadays" for a reason: it's a relatively recent change)20:39:01
@tulir:maunium.nettulir((relatively recent = MSC passed a year ago, spec PR merged 6 months ago, synapse implemented 3 months ago))20:43:24
@vfosnar:matrix.orgVojtěch Fošnár joined the room.20:54:57
@krazykirby99999:matrix.orgkrazykirby99999oh, ok21:06:03
@krazykirby99999:matrix.orgkrazykirby99999the spec on the website needs to be updated then21:06:20
@krazykirby99999:matrix.orgkrazykirby99999unless it was caching on my part21:06:25

I have discovered that even from asyncClient nio can send a join_room message to a server with empty body and without raising any errors (until server itself complains in response)
Some checks are missing.

@houkime:m.wfr.moehoukimeor maybe it is ok by the spec (seems all needed data is in eaders and address aanyway?)22:12:33
In reply to @krazykirby99999:matrix.org
the spec on the website needs to be updated then
https://spec.matrix.org/unstable/client-server-api/#get_matrixclientv3accountwhoami is up to date
@tulir:maunium.nettulir(the latest spec release from over a year ago naturally won't have it, because the field was only added to the spec half a year ago. Matrix v1.1 is coming soon though so then it'll be in the stable spec)22:39:35
20 Oct 2021
In reply to @houkime:m.wfr.moe
or maybe it is ok by the spec (seems all needed data is in eaders and address aanyway?)

yep, normal. ok


There are no newer messages yet.

Back to Room List