mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 09:40:12 +01:00
modules/client/login: Set device in user's room on login.
This commit is contained in:
parent
d33b3911b1
commit
aed1c856ef
1 changed files with 12 additions and 2 deletions
|
@ -86,10 +86,20 @@ post__login_password(client &client,
|
|||
// access_token will be committed and the user will be logged in.
|
||||
m::send(m::user::tokens, user_id, "ircd.access_token", access_token,
|
||||
{
|
||||
{ "ip", string(remote(client)) },
|
||||
{ "device", device_id },
|
||||
{ "ip", string(remote(client)) },
|
||||
{ "device_id", device_id },
|
||||
});
|
||||
|
||||
const m::user::room user_room{user};
|
||||
if(!user_room.has("ircd.device", device_id))
|
||||
m::send(user_room, user_id, "ircd.device", device_id, json::members
|
||||
{
|
||||
{ "device_id", device_id },
|
||||
{ "display_name", initial_device_display_name },
|
||||
{ "last_seen_ts", ircd::time<milliseconds>() },
|
||||
{ "last_seen_ip", string(remote(client)) },
|
||||
});
|
||||
|
||||
// Send response to user
|
||||
return resource::response
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue