mirror of
https://github.com/matrix-construct/construct
synced 2024-09-08 01:35:39 +02: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
|
@ -87,7 +87,17 @@ post__login_password(client &client,
|
||||||
m::send(m::user::tokens, user_id, "ircd.access_token", access_token,
|
m::send(m::user::tokens, user_id, "ircd.access_token", access_token,
|
||||||
{
|
{
|
||||||
{ "ip", string(remote(client)) },
|
{ "ip", string(remote(client)) },
|
||||||
{ "device", device_id },
|
{ "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
|
// Send response to user
|
||||||
|
|
Loading…
Reference in a new issue