0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd:Ⓜ️ Ignore my_host's signature when adding signatures.

This commit is contained in:
Jason Volk 2018-05-18 16:42:25 -07:00
parent 4be4186730
commit 986f591caa

View file

@ -724,7 +724,7 @@ ircd::m::event::signatures(const mutable_buffer &out,
}
ircd::m::event
ircd::m::signatures(const mutable_buffer &out,
ircd::m::signatures(const mutable_buffer &out_,
const m::event &event_)
{
thread_local char content[64_KiB];
@ -759,9 +759,11 @@ ircd::m::signatures(const mutable_buffer &out,
size_t i(0);
sigs.at(i++) = my_sig;
for(const auto &other : json::get<"signatures"_>(event_))
sigs.at(i++) = { other.first, other.second };
if(!my_host(unquote(other.first)))
sigs.at(i++) = { other.first, other.second };
json::get<"signatures"_>(event) = json::stringify(mutable_buffer{out}, sigs.data(), sigs.data() + i);
mutable_buffer out{out_};
json::get<"signatures"_>(event) = json::stringify(out, sigs.data(), sigs.data() + i);
return event;
}