mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd:Ⓜ️:push: Use zero-copy closure to fetch displayname.
This commit is contained in:
parent
7ca990e1ee
commit
edecb8b9ae
1 changed files with 6 additions and 5 deletions
|
@ -278,13 +278,14 @@ try
|
||||||
opts.user_id
|
opts.user_id
|
||||||
};
|
};
|
||||||
|
|
||||||
char buf[256];
|
bool ret{false};
|
||||||
const string_view displayname
|
profile.get(std::nothrow, "displayname", [&ret, &body]
|
||||||
|
(const string_view &, const json::string &displayname)
|
||||||
{
|
{
|
||||||
profile.get(buf, "displayname")
|
ret = displayname && has(body, displayname);
|
||||||
};
|
});
|
||||||
|
|
||||||
return displayname && has(body, displayname);
|
return ret;
|
||||||
}
|
}
|
||||||
catch(const ctx::interrupted &)
|
catch(const ctx::interrupted &)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue