From ade6ad79d928668502b0aa3bf6a99e7421e7763a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 6 Apr 2018 22:08:31 -0700 Subject: [PATCH] modules/console: Support alias to id translation for room cmd suite. --- modules/console.cc | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index d15aeae16..dfbe789e5 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -1449,9 +1449,9 @@ console_cmd__exec__file(opt &out, const string_view &line) bool console_cmd__room__head(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const m::room room @@ -1466,9 +1466,9 @@ console_cmd__room__head(opt &out, const string_view &line) bool console_cmd__room__depth(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const m::room room @@ -1483,9 +1483,9 @@ console_cmd__room__depth(opt &out, const string_view &line) bool console_cmd__room__members(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const string_view membership @@ -1519,9 +1519,9 @@ console_cmd__room__members(opt &out, const string_view &line) bool console_cmd__room__origins(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const m::room room @@ -1546,9 +1546,9 @@ console_cmd__room__origins(opt &out, const string_view &line) bool console_cmd__room__state(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const auto &event_id @@ -1577,9 +1577,9 @@ console_cmd__room__state(opt &out, const string_view &line) bool console_cmd__room__count(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const string_view &type @@ -1608,9 +1608,9 @@ console_cmd__room__count(opt &out, const string_view &line) bool console_cmd__room__messages(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const int64_t depth @@ -1641,9 +1641,9 @@ console_cmd__room__messages(opt &out, const string_view &line) bool console_cmd__room__get(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const string_view type @@ -1680,7 +1680,7 @@ console_cmd__room__set(opt &out, const string_view &line) } }; - const m::room::id room_id + const auto &room_id { param.at(0) }; @@ -1722,9 +1722,9 @@ console_cmd__room__set(opt &out, const string_view &line) bool console_cmd__room__message(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const m::user::id &sender @@ -1754,9 +1754,9 @@ console_cmd__room__message(opt &out, const string_view &line) bool console_cmd__room__redact(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; const m::event::id &redacts @@ -1876,9 +1876,9 @@ console_cmd__room__id(opt &out, const string_view &id) bool console_cmd__room__purge(opt &out, const string_view &line) { - const m::room::id room_id + const auto &room_id { - token(line, ' ', 0) + m::room_id(token(line, ' ', 0)) }; return true;