purple: Add a way to access the account password

This commit is contained in:
2021-04-10 18:22:48 +01:00
parent e3e43005d2
commit 428b26170a

View File

@@ -39,6 +39,17 @@ impl<P> RegisterContext<P> {
self.info.actions = Some(entrypoints::actions); self.info.actions = Some(entrypoints::actions);
self self
} }
pub fn with_password(mut self) -> Self {
// purple_sys defaults extra_info.options to contain:
// OPT_PROTO_NO_PASSWORD | OPT_PROTO_IM_IMAGE | OPT_PROTO_CHAT_TOPIC
// All we have to do is remove the no_password one.
self.extra_info.options =
purple_sys::PurpleProtocolOptions::OPT_PROTO_IM_IMAGE |
purple_sys::PurpleProtocolOptions::OPT_PROTO_CHAT_TOPIC;
self
}
} }
pub struct PrplPluginLoader<P: PrplPlugin>(*mut purple_sys::PurplePlugin, PhantomData<P>); pub struct PrplPluginLoader<P: PrplPlugin>(*mut purple_sys::PurplePlugin, PhantomData<P>);