0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-02 21:59:02 +02:00

modules/console: Add cmd to set a user presence.

This commit is contained in:
Jason Volk 2019-08-17 02:42:36 -07:00
parent ad126fecdf
commit 45a435d8f9

View file

@ -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)
{