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
This commit is contained in:
2021-04-10 14:26:42 +01:00
parent dedd12c66a
commit e3e43005d2

View File

@@ -134,5 +134,15 @@ 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<T: crate::purple::handlers::traits::GetChatBuddyAlias> RegisterContext<T> {
#[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::<T>);
self
}
}