experimental group message support
This commit is contained in:
parent
ce64bde436
commit
11485a3d8f
|
@ -18,6 +18,9 @@ pub trait EventHandler {
|
||||||
fn on_new_contact(&self, cwtch: &dyn libcwtch::CwtchLib, profile: &Profile, convo_id: ConversationID) {}
|
fn on_new_contact(&self, cwtch: &dyn libcwtch::CwtchLib, profile: &Profile, convo_id: ConversationID) {}
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
fn on_new_message_from_contact(&self, cwtch: &dyn libcwtch::CwtchLib, profile: &Profile, conversation_id: ConversationID, handle: String, timestamp_received: DateTime<FixedOffset>, message: MessageWrapper) {}
|
fn on_new_message_from_contact(&self, cwtch: &dyn libcwtch::CwtchLib, profile: &Profile, conversation_id: ConversationID, handle: String, timestamp_received: DateTime<FixedOffset>, message: MessageWrapper) {}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
fn on_new_message_from_group(&self, cwtch: &dyn libcwtch::CwtchLib, profile: &Profile, conversation_id: ConversationID, handle: String, timestamp_sent: DateTime<FixedOffset>, message: MessageWrapper) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Cwtch bot
|
/// Cwtch bot
|
||||||
|
@ -192,6 +195,11 @@ impl Imp {
|
||||||
None => {},
|
None => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Event::NewMessageFromGroup { profile_id, conversation_id, timestamp_sent, contact_id, index, message, content_hash, picture, nick, notification, } => {
|
||||||
|
if let Some(profile )= self.profile.as_ref() {
|
||||||
|
handler.on_new_message_from_group(self.cwtch.as_ref(), profile, conversation_id.clone(), nick.clone(), timestamp_sent.clone(), message.clone())
|
||||||
|
}
|
||||||
|
}
|
||||||
Event::ErrUnhandled { name, data } => eprintln!("unhandled event: {}!", name),
|
Event::ErrUnhandled { name, data } => eprintln!("unhandled event: {}!", name),
|
||||||
_ => (),
|
_ => (),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue