event_emitter: romove events for another PR

master
Devin R 2020-05-06 06:27:27 -04:00
parent 7c7aaee22e
commit e0400bd4e6
2 changed files with 15 additions and 24 deletions

View File

@ -19,7 +19,6 @@ use crate::events::{
ignored_user_list::IgnoredUserListEvent,
presence::PresenceEvent,
push_rules::PushRulesEvent,
receipt::ReceiptEvent,
room::{
aliases::AliasesEvent,
avatar::AvatarEvent,
@ -36,7 +35,6 @@ use crate::events::{
StrippedRoomAliases, StrippedRoomAvatar, StrippedRoomCanonicalAlias, StrippedRoomJoinRules,
StrippedRoomMember, StrippedRoomName, StrippedRoomPowerLevels,
},
typing::TypingEvent,
};
use crate::models::Room;
use tokio::sync::RwLock;
@ -107,10 +105,6 @@ pub trait EventEmitter: Send + Sync {
async fn on_room_power_levels(&self, _: Arc<RwLock<Room>>, _: &PowerLevelsEvent) {}
/// Fires when `AsyncClient` receives a `RoomEvent::Tombstone` event.
async fn on_room_tombstone(&self, _: Arc<RwLock<Room>>, _: &TombstoneEvent) {}
/// Fires when `AsyncClient` receives a `NonRoomEvent::Typing` event.
async fn on_account_data_typing(&self, _: Arc<RwLock<Room>>, _: &TypingEvent) {}
/// Fires when `AsyncClient` receives a `NonRoomEvent::Typing` event.
async fn on_account_data_receipt(&self, _: Arc<RwLock<Room>>, _: &ReceiptEvent) {}
// `RoomEvent`s from `IncomingState`
/// Fires when `AsyncClient` receives a `StateEvent::RoomMember` event.
@ -306,7 +300,7 @@ mod test {
use std::time::Duration;
#[tokio::test]
async fn event_emitter_sync() {
async fn event_emitter_joined() {
let homeserver = Url::from_str(&mockito::server_url()).unwrap();
let session = Session {

View File

@ -397,15 +397,15 @@ impl Room {
pub fn receive_timeline_event(&mut self, event: &RoomEvent) -> bool {
match event {
// update to the current members of the room
RoomEvent::RoomMember(member) => self.handle_membership(member),
RoomEvent::RoomMember(m) => self.handle_membership(m),
// finds all events related to the name of the room for later use
RoomEvent::RoomName(name) => self.handle_room_name(name),
RoomEvent::RoomCanonicalAlias(c_alias) => self.handle_canonical(c_alias),
RoomEvent::RoomAliases(alias) => self.handle_room_aliases(alias),
RoomEvent::RoomName(n) => self.handle_room_name(n),
RoomEvent::RoomCanonicalAlias(ca) => self.handle_canonical(ca),
RoomEvent::RoomAliases(a) => self.handle_room_aliases(a),
// power levels of the room members
RoomEvent::RoomPowerLevels(power) => self.handle_power_level(power),
RoomEvent::RoomTombstone(tomb) => self.handle_tombstone(tomb),
RoomEvent::RoomEncryption(encrypt) => self.handle_encryption_event(encrypt),
RoomEvent::RoomPowerLevels(p) => self.handle_power_level(p),
RoomEvent::RoomTombstone(t) => self.handle_tombstone(t),
RoomEvent::RoomEncryption(e) => self.handle_encryption_event(e),
_ => false,
}
}
@ -419,16 +419,13 @@ impl Room {
/// * `event` - The event of the room.
pub fn receive_state_event(&mut self, event: &StateEvent) -> bool {
match event {
// update to the current members of the room
StateEvent::RoomMember(member) => self.handle_membership(member),
// finds all events related to the name of the room for later use
StateEvent::RoomName(name) => self.handle_room_name(name),
StateEvent::RoomCanonicalAlias(c_alias) => self.handle_canonical(c_alias),
StateEvent::RoomAliases(alias) => self.handle_room_aliases(alias),
// power levels of the room members
StateEvent::RoomPowerLevels(power) => self.handle_power_level(power),
StateEvent::RoomTombstone(tomb) => self.handle_tombstone(tomb),
StateEvent::RoomEncryption(encrypt) => self.handle_encryption_event(encrypt),
StateEvent::RoomMember(m) => self.handle_membership(m),
StateEvent::RoomName(n) => self.handle_room_name(n),
StateEvent::RoomCanonicalAlias(ca) => self.handle_canonical(ca),
StateEvent::RoomAliases(a) => self.handle_room_aliases(a),
StateEvent::RoomPowerLevels(p) => self.handle_power_level(p),
StateEvent::RoomTombstone(t) => self.handle_tombstone(t),
StateEvent::RoomEncryption(e) => self.handle_encryption_event(e),
_ => false,
}
}