mirror of
https://github.com/matrix-construct/construct
synced 2025-03-13 21:10:32 +01:00
modules/console: Add user devices preliminary omni update trigger cmd.
This commit is contained in:
parent
b2a9efc6f9
commit
c973062086
1 changed files with 45 additions and 0 deletions
|
@ -11963,6 +11963,51 @@ console_cmd__user__devices(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__user__devices__update(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"user_id", "device_id", "deleted"
|
||||
}};
|
||||
|
||||
const m::user::id &user_id
|
||||
{
|
||||
param.at("user_id")
|
||||
};
|
||||
|
||||
const string_view &device_id
|
||||
{
|
||||
param.at("device_id")
|
||||
};
|
||||
|
||||
const bool deleted
|
||||
{
|
||||
param["deleted"] == "deleted"
|
||||
};
|
||||
|
||||
const m::user::devices devices
|
||||
{
|
||||
user_id
|
||||
};
|
||||
|
||||
json::iov content;
|
||||
const json::iov::push push[]
|
||||
{
|
||||
{ content, { "user_id", user_id } },
|
||||
{ content, { "device_id", device_id } },
|
||||
{ content, { "deleted", deleted } },
|
||||
};
|
||||
|
||||
const bool broadcasted
|
||||
{
|
||||
m::user::devices::send(content)
|
||||
};
|
||||
|
||||
out << "done" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_id__device(opt &out,
|
||||
const m::device::id &id,
|
||||
|
|
Loading…
Add table
Reference in a new issue