Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get devices of event sender Error 404 #75

Closed
foobar256 opened this issue May 7, 2022 · 1 comment
Closed

Get devices of event sender Error 404 #75

foobar256 opened this issue May 7, 2022 · 1 comment

Comments

@foobar256
Copy link

Code snippet:

syncer.OnEventType(event.StateMember, func(source mautrix.EventSource, evt *event.Event) {
		if evt.Content.AsMember().Membership == event.MembershipJoin {
			fmt.Println(client.GetDeviceInfo(id.DeviceID(evt.Sender)))
		}
...

Output:
<nil> failed to GET /_matrix/client/r0/devices/@user:homeserver.tld: M_NOT_FOUND (HTTP 404): Not found

@tulir
Copy link
Member

tulir commented May 7, 2022

GetDeviceInfo gets your own device info and it takes a device ID (as the parameter type suggests), not a user ID.

QueryKeys is for fetching other users devices (https://spec.matrix.org/v1.2/client-server-api/#post_matrixclientv3keysquery)

@tulir tulir closed this as completed May 7, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants