mirror of
https://github.com/matrix-construct/construct
synced 2024-09-26 18:38:52 +02:00
ircd:Ⓜ️ Rename event id generator function.
This commit is contained in:
parent
7f3919dd17
commit
d64adf8916
3 changed files with 9 additions and 16 deletions
|
@ -24,9 +24,8 @@ namespace ircd::m
|
|||
bool check_size(std::nothrow_t, const event &);
|
||||
void check_size(const event &);
|
||||
|
||||
id::event event_id(const event &, id::event::buf &buf, const const_buffer &hash);
|
||||
id::event event_id(const event &, id::event::buf &buf);
|
||||
id::event event_id(const event &);
|
||||
id::event make_id(const event &, id::event::buf &buf, const const_buffer &hash);
|
||||
id::event make_id(const event &, id::event::buf &buf);
|
||||
|
||||
std::string pretty(const event &);
|
||||
std::string pretty_oneline(const event &, const bool &content_keys = true);
|
||||
|
|
|
@ -46,17 +46,17 @@ ircd::m::operator<(const event &a, const event &b)
|
|||
}
|
||||
|
||||
ircd::m::id::event
|
||||
ircd::m::event_id(const event &event,
|
||||
id::event::buf &buf)
|
||||
ircd::m::make_id(const event &event,
|
||||
id::event::buf &buf)
|
||||
{
|
||||
const crh::sha256::buf hash{event};
|
||||
return event_id(event, buf, hash);
|
||||
return make_id(event, buf, hash);
|
||||
}
|
||||
|
||||
ircd::m::id::event
|
||||
ircd::m::event_id(const event &event,
|
||||
id::event::buf &buf,
|
||||
const const_buffer &hash)
|
||||
ircd::m::make_id(const event &event,
|
||||
id::event::buf &buf,
|
||||
const const_buffer &hash)
|
||||
{
|
||||
char readable[b58encode_size(sha256::digest_size)];
|
||||
const id::event ret
|
||||
|
@ -68,12 +68,6 @@ ircd::m::event_id(const event &event,
|
|||
return ret;
|
||||
}
|
||||
|
||||
ircd::m::id::event
|
||||
ircd::m::event_id(const event &event)
|
||||
{
|
||||
return at<"event_id"_>(event);
|
||||
}
|
||||
|
||||
void
|
||||
ircd::m::check_size(const event &event)
|
||||
{
|
||||
|
|
|
@ -113,7 +113,7 @@ ircd::m::vm::commit(json::iov &event,
|
|||
const string_view event_id
|
||||
{
|
||||
opts.event_id?
|
||||
m::event_id(event, eid_buf, event_id_hash):
|
||||
make_id(event, eid_buf, event_id_hash):
|
||||
string_view{}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue