mirror of
https://github.com/matrix-construct/construct
synced 2024-06-10 14:08:56 +02:00
ircd:Ⓜ️:user::devices: Drop updates from unknown users.
This commit is contained in:
parent
9a0a3dfbf1
commit
dcd50f3427
|
@ -59,6 +59,19 @@ ircd::m::user::devices::update(const device_list_update &update)
|
|||
json::at<"user_id"_>(update)
|
||||
};
|
||||
|
||||
// Don't create unknown users on this codepath since there's no efficient
|
||||
// check if this is just spam; updates for unknowns are just dropped here.
|
||||
if(!exists(user))
|
||||
{
|
||||
log::derror
|
||||
{
|
||||
log, "Refusing device update for unknown user %s",
|
||||
string_view{user.user_id},
|
||||
};
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const m::user::devices devices
|
||||
{
|
||||
user
|
||||
|
|
Loading…
Reference in a new issue