0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

ircd:Ⓜ️:push: Use zero-copy closure to fetch displayname.

This commit is contained in:
Jason Volk 2020-03-22 18:06:19 -07:00
parent 7ca990e1ee
commit edecb8b9ae

View file

@ -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 &)
{