mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
add before_login_hint to device-chat on successfull logins
This commit is contained in:
@@ -974,6 +974,11 @@ pub fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::Error> {
|
||||
println!("Information for provider belonging to {}:", arg1);
|
||||
println!("status: {}", info.status as u32);
|
||||
println!("before_login_hint: {}", info.before_login_hint);
|
||||
println!("after_login_hint: {}", info.after_login_hint);
|
||||
println!("overview_page: {}", info.overview_page);
|
||||
for server in info.server.iter() {
|
||||
println!("server: {}:{}", server.server, server.port,);
|
||||
}
|
||||
}
|
||||
None => {
|
||||
println!("No information for provider belonging to {} found.", arg1);
|
||||
|
||||
@@ -16,8 +16,9 @@ use crate::job::{self, job_add, job_kill_action};
|
||||
use crate::login_param::{CertificateChecks, LoginParam};
|
||||
use crate::oauth2::*;
|
||||
use crate::param::Params;
|
||||
use crate::{e2ee, provider};
|
||||
use crate::{chat, e2ee, provider};
|
||||
|
||||
use crate::message::Message;
|
||||
use auto_mozilla::moz_autoconfigure;
|
||||
use auto_outlook::outlk_autodiscover;
|
||||
|
||||
@@ -436,6 +437,16 @@ pub fn JobConfigureImap(context: &Context) -> job::Status {
|
||||
LoginParam::from_database(context, "configured_raw_").save_to_database(context, "");
|
||||
}
|
||||
|
||||
if let Some(provider) = provider::get_provider_info(¶m.addr) {
|
||||
if !provider.after_login_hint.is_empty() {
|
||||
let mut msg = Message::new(Viewtype::Text);
|
||||
msg.text = Some(provider.after_login_hint.to_string());
|
||||
if chat::add_device_msg(context, Some("core-provider-info"), Some(&mut msg)).is_err() {
|
||||
warn!(context, "cannot add after_login_hint as core-provider-info");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context.free_ongoing();
|
||||
progress!(context, if success { 1000 } else { 0 });
|
||||
job::Status::Finished(Ok(()))
|
||||
|
||||
@@ -110,6 +110,15 @@ lazy_static::lazy_static! {
|
||||
server: vec![
|
||||
],
|
||||
},
|
||||
Provider {
|
||||
domains: "testrun.org",
|
||||
status: Status::OK,
|
||||
before_login_hint: "",
|
||||
after_login_hint: "testrun.org is not Delta Chat :)",
|
||||
overview_page: "",
|
||||
server: vec![
|
||||
],
|
||||
},
|
||||
Provider {
|
||||
domains: "gmail.com googlemail.com",
|
||||
status: Status::PREPARATION,
|
||||
|
||||
Reference in New Issue
Block a user