0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

modules/m_user_highlight: Simplify matching.

This commit is contained in:
Jason Volk 2019-08-07 02:10:05 -07:00
parent 2bc795b883
commit 45478ec0bc

View file

@ -199,23 +199,12 @@ const
json::get<"content"_>(event)
};
const string_view &formatted_body
{
content.get("formatted_body")
};
if(match(formatted_body))
return true;
const string_view &body
const json::string &body
{
content.get("body")
};
if(match(body))
return true;
return false;
return match(body);
}
bool
@ -223,7 +212,7 @@ IRCD_MODULE_EXPORT
ircd::m::user::highlight::match(const string_view &text)
const
{
if(likely(match_at_room))
if(match_at_room)
if(startswith(text, "@room"))
return true;