mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/client/sync/rooms/timeline: Fix redundant private echo of public command.
This commit is contained in:
parent
1f947f982c
commit
3064b349dc
1 changed files with 19 additions and 1 deletions
|
@ -224,9 +224,27 @@ ircd::m::sync::room_timeline_linear(data &data)
|
|||
bool
|
||||
ircd::m::sync::_room_timeline_linear_command(data &data)
|
||||
{
|
||||
const auto content
|
||||
{
|
||||
json::get<"content"_>(*data.event)
|
||||
};
|
||||
|
||||
const json::string body
|
||||
{
|
||||
content["body"]
|
||||
};
|
||||
|
||||
// Don't re-echo already public commands
|
||||
if(startswith(lstrip(body, "\\\\"), '!'))
|
||||
return false;
|
||||
|
||||
// Don't re-echo already public command-replyings
|
||||
if(has(body, "\\n\\n\\\\!"))
|
||||
return false;
|
||||
|
||||
const m::room &room
|
||||
{
|
||||
unquote(json::get<"content"_>(*data.event).get("room_id"))
|
||||
unquote(content.get("room_id"))
|
||||
};
|
||||
|
||||
const scope_restore _room
|
||||
|
|
Loading…
Reference in a new issue