0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 08:58:20 +02:00

ircd:Ⓜ️:room::messages: Support seeking to event index of 0 for begin.

This commit is contained in:
Jason Volk 2019-01-10 13:17:01 -08:00
parent 26ee1c9b5c
commit b15d3b929f

View file

@ -748,11 +748,12 @@ bool
ircd::m::room::messages::seek_idx(const event::idx &event_idx)
try
{
uint64_t depth;
m::get(event_idx, "depth", mutable_buffer
{
reinterpret_cast<char *>(&depth), sizeof(depth)
});
uint64_t depth(0);
if(event_idx)
m::get(event_idx, "depth", mutable_buffer
{
reinterpret_cast<char *>(&depth), sizeof(depth)
});
char buf[dbs::ROOM_EVENTS_KEY_MAX_SIZE];
const auto &seek_key
@ -765,7 +766,7 @@ try
return false;
// Check if this event_idx is actually in this room
if(event_idx != this->event_idx())
if(event_idx && event_idx != this->event_idx())
return false;
return true;