mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 09:40:12 +01:00
modules/console: Add basic room messages count as default for room count cmd.
This commit is contained in:
parent
0e956dbaca
commit
d320ce0b47
1 changed files with 16 additions and 5 deletions
|
@ -9395,14 +9395,25 @@ console_cmd__room__count(opt &out, const string_view &line)
|
|||
json::get<"limit"_>(filter)?: -1
|
||||
};
|
||||
|
||||
size_t count{0};
|
||||
m::room::messages it{room};
|
||||
for(; it && limit; --it, --limit)
|
||||
if(param[1])
|
||||
{
|
||||
const m::event &event{*it};
|
||||
count += match(filter, event);
|
||||
size_t count{0};
|
||||
m::room::messages it{room};
|
||||
for(; it && limit; --it, --limit)
|
||||
{
|
||||
const m::event &event{*it};
|
||||
count += match(filter, event);
|
||||
}
|
||||
|
||||
out << count << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
const size_t count
|
||||
{
|
||||
room.count()
|
||||
};
|
||||
|
||||
out << count << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue