From 265e77da6a991efa88ab014a8b536679f808284b Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Sat, 10 Apr 2021 14:26:42 +0100 Subject: [PATCH] purple: Support libpurple 2.13 get_cb_alias was introduced in 2.14 and referencing it directly in this macro breaks compilation against libpurple-2.13, as found in Debian Buster. https://docs.pidgin.im/pidgin/2.x.y/struct__PurplePluginProtocolInfo.html#ad43cef005f1634b0d170cc2972c69550 --- src/purple/loader.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/purple/loader.rs b/src/purple/loader.rs index f577522..e9d668b 100644 --- a/src/purple/loader.rs +++ b/src/purple/loader.rs @@ -134,5 +134,14 @@ impl_extra_handler_builder! { get_chat_name => GetChatNameHandler send_im => SendIMHandler chat_send => ChatSendHandler - get_cb_alias => GetChatBuddyAlias +} + +// get_cb_alias is only available in Purple 2.14 +#[cfg(libpurple2_14)] +impl RegisterContext { + #[allow(dead_code)] + pub fn enable_get_cb_alias(mut self) -> Self { + self.extra_info.get_cb_alias = Some(crate::purple::handlers::entrypoints::get_cb_alias::); + self + } }