Compare commits

..

7 Commits

Author SHA1 Message Date
8e07bcb83b Initial framework based off pidgin-icq 2021-04-10 20:58:29 +01:00
1eb5bbda74 Add a makefile task to run a pidgin 2021-04-10 20:58:28 +01:00
ea50c00b42 Add some more code from pidgin-icq 2021-04-10 20:58:28 +01:00
b98d09a196 purple: Allow protocol options to be configured 2021-04-10 20:58:28 +01:00
d2dfe89394 purple: Add a way to specify the account has a password 2021-04-10 20:51:15 +01:00
428b26170a purple: Add a way to access the account password 2021-04-10 20:51:15 +01:00
e3e43005d2 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
2021-04-10 20:51:15 +01:00
2 changed files with 19 additions and 29 deletions

View File

@@ -82,17 +82,16 @@ pub struct MsgInfo {
pub struct AccountData {
display_name: String,
imap_host: String,
imap_port: i32,
imap_port: String,
imap_user: String,
imap_pass: String,
smtp_host: String,
smtp_port: i32,
smtp_port: String,
smtp_user: String,
smtp_pass: String,
bcc_self: bool,
// Not exposed: server_flags, selfstatus, e2ee_enabled
session_closed: AtomicBool,
// session: RwLock<Option<icq::protocol::SessionInfo>>,
}
@@ -142,18 +141,10 @@ impl purple::PrplPlugin for PurpleDelta {
.with_info(info)
.with_password()
.with_string_option("Display Name".into(), "displayname".into(), "".into())
.with_string_option(
"IMAP server hostname".into(),
"mail_server".into(),
"".into(),
)
.with_string_option("IMAP server host".into(), "mail_server".into(), "".into())
.with_string_option("IMAP server port".into(), "mail_port".into(), "".into())
// Username and password are mail_user and mail_pw
.with_string_option(
"SMTP server hostname".into(),
"send_server".into(),
"".into(),
)
.with_string_option("SMTP server host".into(), "send_server".into(), "".into())
.with_string_option("SMTP server port".into(), "send_port".into(), "".into())
.with_string_option("SMTP server username".into(), "send_user".into(), "".into())
.with_password_option("SMTP server password".into(), "send_pw".into(), "".into())
@@ -161,16 +152,14 @@ impl purple::PrplPlugin for PurpleDelta {
.enable_login()
.enable_load()
.enable_close()
/*
.enable_chat_info()
.enable_chat_info_defaults()
.enable_join_chat()
.enable_chat_leave()
.enable_send_im()
.enable_chat_send()
.enable_convo_closed()
.enable_get_chat_name()
*/
//.enable_chat_info()
//.enable_chat_info_defaults()
//.enable_join_chat()
//.enable_chat_leave()
//.enable_send_im()
//.enable_chat_send()
//.enable_convo_closed()
//.enable_get_chat_name()
.enable_list_icon()
.enable_status_types()
}
@@ -181,12 +170,12 @@ impl purple::LoginHandler for PurpleDelta {
let display_name = account.get_string("displayname", "");
let imap_host = account.get_string("mail_server", "");
let imap_port = account.get_int("mail_port", 0);
let imap_port = account.get_string("mail_port", "");
let imap_user = account.get_username().unwrap().into();
let imap_pass = account.get_password().unwrap().into();
let smtp_host = account.get_string("send_server", "");
let smtp_port = account.get_int("send_port", 0);
let smtp_port = account.get_string("send_port", "");
let smtp_user = account.get_string("send_user", "");
let smtp_pass = account.get_string("send_pw", "");

View File

@@ -83,7 +83,7 @@ impl<P> RegisterContext<P> {
self
}
pub fn with_string_option(mut self, name: String, key: String, def: String) -> Self {
pub fn with_string_option(self, name: String, key: String, def: String) -> Self {
self.with_option(PrplOption {
text: name,
key: key,
@@ -92,7 +92,7 @@ impl<P> RegisterContext<P> {
})
}
pub fn with_password_option(mut self, name: String, key: String, def: String) -> Self {
pub fn with_password_option(self, name: String, key: String, def: String) -> Self {
self.with_option(PrplOption {
text: name,
key: key,
@@ -101,7 +101,7 @@ impl<P> RegisterContext<P> {
})
}
pub fn with_bool_option(mut self, name: String, key: String, def: bool) -> Self {
pub fn with_bool_option(self, name: String, key: String, def: bool) -> Self {
self.with_option(PrplOption {
text: name,
key: key,
@@ -223,7 +223,8 @@ impl_extra_handler_builder! {
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.extra_info.get_cb_alias =
Some(crate::purple::handlers::entrypoints::get_cb_alias::<T>);
self
}
}