Compare commits
7 Commits
f7acc9cf82
...
8e07bcb83b
Author | SHA1 | Date | |
---|---|---|---|
8e07bcb83b | |||
1eb5bbda74 | |||
ea50c00b42 | |||
b98d09a196 | |||
d2dfe89394 | |||
428b26170a | |||
e3e43005d2 |
39
src/lib.rs
39
src/lib.rs
@@ -82,17 +82,16 @@ pub struct MsgInfo {
|
|||||||
pub struct AccountData {
|
pub struct AccountData {
|
||||||
display_name: String,
|
display_name: String,
|
||||||
imap_host: String,
|
imap_host: String,
|
||||||
imap_port: i32,
|
imap_port: String,
|
||||||
imap_user: String,
|
imap_user: String,
|
||||||
imap_pass: String,
|
imap_pass: String,
|
||||||
smtp_host: String,
|
smtp_host: String,
|
||||||
smtp_port: i32,
|
smtp_port: String,
|
||||||
smtp_user: String,
|
smtp_user: String,
|
||||||
smtp_pass: String,
|
smtp_pass: String,
|
||||||
bcc_self: bool,
|
bcc_self: bool,
|
||||||
|
|
||||||
// Not exposed: server_flags, selfstatus, e2ee_enabled
|
// Not exposed: server_flags, selfstatus, e2ee_enabled
|
||||||
|
|
||||||
session_closed: AtomicBool,
|
session_closed: AtomicBool,
|
||||||
// session: RwLock<Option<icq::protocol::SessionInfo>>,
|
// session: RwLock<Option<icq::protocol::SessionInfo>>,
|
||||||
}
|
}
|
||||||
@@ -142,18 +141,10 @@ impl purple::PrplPlugin for PurpleDelta {
|
|||||||
.with_info(info)
|
.with_info(info)
|
||||||
.with_password()
|
.with_password()
|
||||||
.with_string_option("Display Name".into(), "displayname".into(), "".into())
|
.with_string_option("Display Name".into(), "displayname".into(), "".into())
|
||||||
.with_string_option(
|
.with_string_option("IMAP server host".into(), "mail_server".into(), "".into())
|
||||||
"IMAP server hostname".into(),
|
|
||||||
"mail_server".into(),
|
|
||||||
"".into(),
|
|
||||||
)
|
|
||||||
.with_string_option("IMAP server port".into(), "mail_port".into(), "".into())
|
.with_string_option("IMAP server port".into(), "mail_port".into(), "".into())
|
||||||
// Username and password are mail_user and mail_pw
|
// Username and password are mail_user and mail_pw
|
||||||
.with_string_option(
|
.with_string_option("SMTP server host".into(), "send_server".into(), "".into())
|
||||||
"SMTP server hostname".into(),
|
|
||||||
"send_server".into(),
|
|
||||||
"".into(),
|
|
||||||
)
|
|
||||||
.with_string_option("SMTP server port".into(), "send_port".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_string_option("SMTP server username".into(), "send_user".into(), "".into())
|
||||||
.with_password_option("SMTP server password".into(), "send_pw".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_login()
|
||||||
.enable_load()
|
.enable_load()
|
||||||
.enable_close()
|
.enable_close()
|
||||||
/*
|
//.enable_chat_info()
|
||||||
.enable_chat_info()
|
//.enable_chat_info_defaults()
|
||||||
.enable_chat_info_defaults()
|
//.enable_join_chat()
|
||||||
.enable_join_chat()
|
//.enable_chat_leave()
|
||||||
.enable_chat_leave()
|
//.enable_send_im()
|
||||||
.enable_send_im()
|
//.enable_chat_send()
|
||||||
.enable_chat_send()
|
//.enable_convo_closed()
|
||||||
.enable_convo_closed()
|
//.enable_get_chat_name()
|
||||||
.enable_get_chat_name()
|
|
||||||
*/
|
|
||||||
.enable_list_icon()
|
.enable_list_icon()
|
||||||
.enable_status_types()
|
.enable_status_types()
|
||||||
}
|
}
|
||||||
@@ -181,12 +170,12 @@ impl purple::LoginHandler for PurpleDelta {
|
|||||||
let display_name = account.get_string("displayname", "");
|
let display_name = account.get_string("displayname", "");
|
||||||
|
|
||||||
let imap_host = account.get_string("mail_server", "");
|
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_user = account.get_username().unwrap().into();
|
||||||
let imap_pass = account.get_password().unwrap().into();
|
let imap_pass = account.get_password().unwrap().into();
|
||||||
|
|
||||||
let smtp_host = account.get_string("send_server", "");
|
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_user = account.get_string("send_user", "");
|
||||||
let smtp_pass = account.get_string("send_pw", "");
|
let smtp_pass = account.get_string("send_pw", "");
|
||||||
|
|
||||||
|
@@ -83,7 +83,7 @@ impl<P> RegisterContext<P> {
|
|||||||
self
|
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 {
|
self.with_option(PrplOption {
|
||||||
text: name,
|
text: name,
|
||||||
key: key,
|
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 {
|
self.with_option(PrplOption {
|
||||||
text: name,
|
text: name,
|
||||||
key: key,
|
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 {
|
self.with_option(PrplOption {
|
||||||
text: name,
|
text: name,
|
||||||
key: key,
|
key: key,
|
||||||
@@ -223,7 +223,8 @@ impl_extra_handler_builder! {
|
|||||||
impl<T: crate::purple::handlers::traits::GetChatBuddyAlias> RegisterContext<T> {
|
impl<T: crate::purple::handlers::traits::GetChatBuddyAlias> RegisterContext<T> {
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn enable_get_cb_alias(mut self) -> Self {
|
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
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user