mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-16 12:18:59 -05:00
re-export ruma Event trait through core pdu
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
e7e606300f
commit
6c9ecb031a
3 changed files with 6 additions and 4 deletions
31
src/core/pdu/event.rs
Normal file
31
src/core/pdu/event.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
pub use ruma::state_res::Event;
|
||||
use ruma::{events::TimelineEventType, EventId, MilliSecondsSinceUnixEpoch, RoomId, UserId};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
use super::PduEvent;
|
||||
|
||||
impl Event for PduEvent {
|
||||
type Id = Arc<EventId>;
|
||||
|
||||
fn event_id(&self) -> &Self::Id { &self.event_id }
|
||||
|
||||
fn room_id(&self) -> &RoomId { &self.room_id }
|
||||
|
||||
fn sender(&self) -> &UserId { &self.sender }
|
||||
|
||||
fn event_type(&self) -> &TimelineEventType { &self.kind }
|
||||
|
||||
fn content(&self) -> &RawJsonValue { &self.content }
|
||||
|
||||
fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch { MilliSecondsSinceUnixEpoch(self.origin_server_ts) }
|
||||
|
||||
fn state_key(&self) -> Option<&str> { self.state_key.as_deref() }
|
||||
|
||||
fn prev_events(&self) -> impl DoubleEndedIterator<Item = &Self::Id> + Send + '_ { self.prev_events.iter() }
|
||||
|
||||
fn auth_events(&self) -> impl DoubleEndedIterator<Item = &Self::Id> + Send + '_ { self.auth_events.iter() }
|
||||
|
||||
fn redacts(&self) -> Option<&Self::Id> { self.redacts.as_ref() }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue