aboutsummaryrefslogtreecommitdiff
path: root/src/client/event_handler.rs
diff options
context:
space:
mode:
authorAdelyn <[email protected]>2018-08-26 15:25:33 -0600
committerzeyla <[email protected]>2018-08-26 14:25:33 -0700
commit27ccf2c9c8ce785b54595eaabcebf86db07bf5bc (patch)
tree6a19d241626a082ecf06c0cf626463f0ea2df7bd /src/client/event_handler.rs
parentMove low-level http functions to a raw module (diff)
downloadserenity-27ccf2c9c8ce785b54595eaabcebf86db07bf5bc.tar.xz
serenity-27ccf2c9c8ce785b54595eaabcebf86db07bf5bc.zip
Old message on update (#368)
Diffstat (limited to 'src/client/event_handler.rs')
-rw-r--r--src/client/event_handler.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/client/event_handler.rs b/src/client/event_handler.rs
index 32fdaa1..5af7314 100644
--- a/src/client/event_handler.rs
+++ b/src/client/event_handler.rs
@@ -212,6 +212,18 @@ pub trait EventHandler {
/// Provides the channel's id and the deleted messages' ids.
fn message_delete_bulk(&self, _ctx: Context, _channel_id: ChannelId, _multiple_deleted_messages_ids: Vec<MessageId>) {}
+ /// Dispatched when a message is updated.
+ ///
+ /// Provides the old message if available and the new message.
+ #[cfg(feature = "cache")]
+ fn message_update(&self, _ctx: Context, _old_if_available: Option<Message>, _new: Message) {}
+
+ /// Dispatched when a message is updated.
+ ///
+ /// Provides the new data of the message.
+ #[cfg(not(feature = "cache"))]
+ fn message_update(&self, _ctx: Context, _new_data: MessageUpdateEvent) {}
+
/// Dispatched when a new reaction is attached to a message.
///
/// Provides the reaction's data.
@@ -227,11 +239,6 @@ pub trait EventHandler {
/// Provides the channel's id and the message's id.
fn reaction_remove_all(&self, _ctx: Context, _channel_id: ChannelId, _removed_from_message_id: MessageId) {}
- /// Dispatched when a message is updated.
- ///
- /// Provides the new data of the message.
- fn message_update(&self, _ctx: Context, _new_data: MessageUpdateEvent) {}
-
fn presence_replace(&self, _ctx: Context, _: Vec<Presence>) {}
/// Dispatched when a user's presence is updated (e.g off -> on).