From 6c43a47d87fc4eb8af52db50bfe476caa2203065 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 6 May 2019 14:36:49 -0700 Subject: [PATCH] ircd::m::room::messages: Add event_idx convenience conversion. --- include/ircd/m/room/messages.h | 2 ++ ircd/m_room.cc | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/ircd/m/room/messages.h b/include/ircd/m/room/messages.h index 999194690..b9a5b5575 100644 --- a/include/ircd/m/room/messages.h +++ b/include/ircd/m/room/messages.h @@ -57,6 +57,8 @@ struct ircd::m::room::messages uint64_t depth() const; // Available from the iterator key. string_view state_root() const; // Available from the iterator value. + explicit operator event::idx() const; + const m::event &fetch(std::nothrow_t); const m::event &fetch(); diff --git a/ircd/m_room.cc b/ircd/m_room.cc index fcb17ad1e..372518d96 100644 --- a/ircd/m_room.cc +++ b/ircd/m_room.cc @@ -1781,6 +1781,13 @@ catch(const db::not_found &e) return false; } +ircd::m::room::messages::operator +ircd::m::event::idx() +const +{ + return event_idx(); +} + ircd::m::event::id::buf ircd::m::room::messages::event_id() const