mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
modules/console: Add cmd to set a user presence.
This commit is contained in:
parent
ad126fecdf
commit
45a435d8f9
1 changed files with 32 additions and 0 deletions
|
@ -10346,6 +10346,38 @@ console_cmd__user__presence(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__user__presence__set(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"user_id", "state", "status"
|
||||
}};
|
||||
|
||||
const m::user user
|
||||
{
|
||||
param.at("user_id")
|
||||
};
|
||||
|
||||
const string_view &state
|
||||
{
|
||||
param.at("state")
|
||||
};
|
||||
|
||||
const string_view &status
|
||||
{
|
||||
param["status"]
|
||||
};
|
||||
|
||||
const auto eid
|
||||
{
|
||||
m::presence::set(user, state, status)
|
||||
};
|
||||
|
||||
out << eid << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__user__rooms(opt &out, const string_view &line)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue