0
0
Fork 0
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:
Jason Volk 2022-07-31 04:59:44 -07:00
parent 1f947f982c
commit 3064b349dc

View file

@ -224,9 +224,27 @@ ircd::m::sync::room_timeline_linear(data &data)
bool bool
ircd::m::sync::_room_timeline_linear_command(data &data) 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 const m::room &room
{ {
unquote(json::get<"content"_>(*data.event).get("room_id")) unquote(content.get("room_id"))
}; };
const scope_restore _room const scope_restore _room