mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +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
|
||||
};
|
||||
|
||||
char buf[256];
|
||||
const string_view displayname
|
||||
bool ret{false};
|
||||
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 &)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue