Skip to content

Commit

Permalink
modules/console: Add room annotate cmd.
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Jun 29, 2023
1 parent 0a592ec commit e907463
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions modules/console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12544,6 +12544,48 @@ console_cmd__room__msghtml(opt &out, const string_view &line)
return true;
}

bool
console_cmd__room__annotate(opt &out, const string_view &line)
{
const params param{line, " ",
{
"room_id", "user_id", "event_id", "key"
}};

const auto room_id
{
m::room_id(param.at("room_id"))
};

const m::user::id sender
{
param.at("user_id")
};

const m::event::id event_id
{
param.at("event_id")
};

const string_view key
{
param.at("key")
};

const m::room room
{
room_id
};

const auto annote_id
{
annotate(room, sender, event_id, key)
};

out << annote_id << std::endl;
return true;
}

bool
console_cmd__room__join(opt &out, const string_view &line)
{
Expand Down

0 comments on commit e907463

Please sign in to comment.