mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +02:00
ircd:Ⓜ️:room::messages: Support seeking to event index of 0 for begin.
This commit is contained in:
parent
26ee1c9b5c
commit
b15d3b929f
1 changed files with 7 additions and 6 deletions
|
@ -748,11 +748,12 @@ bool
|
||||||
ircd::m::room::messages::seek_idx(const event::idx &event_idx)
|
ircd::m::room::messages::seek_idx(const event::idx &event_idx)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
uint64_t depth;
|
uint64_t depth(0);
|
||||||
m::get(event_idx, "depth", mutable_buffer
|
if(event_idx)
|
||||||
{
|
m::get(event_idx, "depth", mutable_buffer
|
||||||
reinterpret_cast<char *>(&depth), sizeof(depth)
|
{
|
||||||
});
|
reinterpret_cast<char *>(&depth), sizeof(depth)
|
||||||
|
});
|
||||||
|
|
||||||
char buf[dbs::ROOM_EVENTS_KEY_MAX_SIZE];
|
char buf[dbs::ROOM_EVENTS_KEY_MAX_SIZE];
|
||||||
const auto &seek_key
|
const auto &seek_key
|
||||||
|
@ -765,7 +766,7 @@ try
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check if this event_idx is actually in this room
|
// 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 false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue