Compare commits
7 Commits
8e07bcb83b
...
f7acc9cf82
Author | SHA1 | Date | |
---|---|---|---|
f7acc9cf82 | |||
af7e951408 | |||
3389ba8e81 | |||
13e90a691f | |||
fcce5e9da0 | |||
c98d1920b4 | |||
265e77da6a |
39
src/lib.rs
39
src/lib.rs
@@ -82,16 +82,17 @@ pub struct MsgInfo {
|
||||
pub struct AccountData {
|
||||
display_name: String,
|
||||
imap_host: String,
|
||||
imap_port: String,
|
||||
imap_port: i32,
|
||||
imap_user: String,
|
||||
imap_pass: String,
|
||||
smtp_host: String,
|
||||
smtp_port: String,
|
||||
smtp_port: i32,
|
||||
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>>,
|
||||
}
|
||||
@@ -141,10 +142,18 @@ impl purple::PrplPlugin for PurpleDelta {
|
||||
.with_info(info)
|
||||
.with_password()
|
||||
.with_string_option("Display Name".into(), "displayname".into(), "".into())
|
||||
.with_string_option("IMAP server host".into(), "mail_server".into(), "".into())
|
||||
.with_string_option(
|
||||
"IMAP server hostname".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 host".into(), "send_server".into(), "".into())
|
||||
.with_string_option(
|
||||
"SMTP server hostname".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())
|
||||
@@ -152,14 +161,16 @@ 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()
|
||||
}
|
||||
@@ -170,12 +181,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_string("mail_port", "");
|
||||
let imap_port = account.get_int("mail_port", 0);
|
||||
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_string("send_port", "");
|
||||
let smtp_port = account.get_int("send_port", 0);
|
||||
let smtp_user = account.get_string("send_user", "");
|
||||
let smtp_pass = account.get_string("send_pw", "");
|
||||
|
||||
|
@@ -83,7 +83,7 @@ impl<P> RegisterContext<P> {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_string_option(self, name: String, key: String, def: String) -> Self {
|
||||
pub fn with_string_option(mut 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(self, name: String, key: String, def: String) -> Self {
|
||||
pub fn with_password_option(mut 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(self, name: String, key: String, def: bool) -> Self {
|
||||
pub fn with_bool_option(mut self, name: String, key: String, def: bool) -> Self {
|
||||
self.with_option(PrplOption {
|
||||
text: name,
|
||||
key: key,
|
||||
@@ -223,8 +223,7 @@ 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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user