mirror of
https://github.com/matrix-construct/construct
synced 2025-02-19 18:20:19 +01:00
modules/console: Add arguments to allow modification of account_data and room_account_data.
This commit is contained in:
parent
8f335ca1bb
commit
94503e6d5f
1 changed files with 24 additions and 2 deletions
|
@ -9224,7 +9224,7 @@ console_cmd__user__account_data(opt &out, const string_view &line)
|
|||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"user_id", "key"
|
||||
"user_id", "key", "[val]"
|
||||
}};
|
||||
|
||||
const m::user::id &user_id
|
||||
|
@ -9237,11 +9237,22 @@ console_cmd__user__account_data(opt &out, const string_view &line)
|
|||
param["key"]
|
||||
};
|
||||
|
||||
const json::object &val
|
||||
{
|
||||
param["[val]"]
|
||||
};
|
||||
|
||||
const m::user::account_data account_data
|
||||
{
|
||||
user_id
|
||||
};
|
||||
|
||||
if(!empty(val))
|
||||
{
|
||||
account_data.set(key, val);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(key)
|
||||
{
|
||||
account_data.get(key, [&out]
|
||||
|
@ -9268,7 +9279,7 @@ console_cmd__user__room_account_data(opt &out, const string_view &line)
|
|||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"user_id", "room_id", "key"
|
||||
"user_id", "room_id", "key", "[val]"
|
||||
}};
|
||||
|
||||
const m::user::id &user_id
|
||||
|
@ -9286,11 +9297,22 @@ console_cmd__user__room_account_data(opt &out, const string_view &line)
|
|||
param["key"]
|
||||
};
|
||||
|
||||
const json::object &val
|
||||
{
|
||||
param["[val]"]
|
||||
};
|
||||
|
||||
const m::user::room_account_data room_account_data
|
||||
{
|
||||
user_id, room_id
|
||||
};
|
||||
|
||||
if(!empty(val))
|
||||
{
|
||||
room_account_data.set(key, val);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(key)
|
||||
{
|
||||
room_account_data.get(key, [&out]
|
||||
|
|
Loading…
Add table
Reference in a new issue