mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
replace unsafe use of dc logging with info! macro as per advise from @flub
This commit is contained in:
@@ -223,6 +223,25 @@ class TestOnlineAccount:
|
|||||||
assert ev[1] == msg_out.id
|
assert ev[1] == msg_out.id
|
||||||
assert 0
|
assert 0
|
||||||
|
|
||||||
|
def test_two_acocunts_send_receive(self, acfactory):
|
||||||
|
ac1 = acfactory.get_online_configuring_account()
|
||||||
|
ac2 = acfactory.get_online_configuring_account()
|
||||||
|
c2 = ac1.create_contact(email=ac2.get_config("addr"))
|
||||||
|
chat = ac1.create_chat_by_contact(c2)
|
||||||
|
assert chat.id >= const.DC_CHAT_ID_LAST_SPECIAL
|
||||||
|
#wait_successful_IMAP_SMTP_connection(ac1)
|
||||||
|
wait_configuration_progress(ac1, 1000)
|
||||||
|
#wait_successful_IMAP_SMTP_connection(ac2)
|
||||||
|
wait_configuration_progress(ac2, 1000)
|
||||||
|
|
||||||
|
msg_out = chat.send_text("message1")
|
||||||
|
|
||||||
|
# wait for other account to receive
|
||||||
|
ev = ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
|
||||||
|
assert ev[2] == msg_out.id
|
||||||
|
msg_in = ac2.get_message_by_id(msg_out.id)
|
||||||
|
assert msg_in.text == "message1"
|
||||||
|
|
||||||
def test_forward_messages(self, acfactory):
|
def test_forward_messages(self, acfactory):
|
||||||
ac1 = acfactory.get_online_configuring_account()
|
ac1 = acfactory.get_online_configuring_account()
|
||||||
ac2 = acfactory.get_online_configuring_account()
|
ac2 = acfactory.get_online_configuring_account()
|
||||||
|
|||||||
11
src/smtp.rs
11
src/smtp.rs
@@ -10,6 +10,7 @@ use crate::dc_log::*;
|
|||||||
use crate::dc_loginparam::*;
|
use crate::dc_loginparam::*;
|
||||||
use crate::dc_tools::*;
|
use crate::dc_tools::*;
|
||||||
use crate::oauth2::*;
|
use crate::oauth2::*;
|
||||||
|
use crate::types::*;
|
||||||
|
|
||||||
pub struct Smtp {
|
pub struct Smtp {
|
||||||
transport: Option<lettre::smtp::SmtpTransport>,
|
transport: Option<lettre::smtp::SmtpTransport>,
|
||||||
@@ -48,15 +49,7 @@ impl Smtp {
|
|||||||
|
|
||||||
/// Connect using the provided login params
|
/// Connect using the provided login params
|
||||||
pub fn connect(&mut self, context: &Context, lp: *const dc_loginparam_t) -> usize {
|
pub fn connect(&mut self, context: &Context, lp: *const dc_loginparam_t) -> usize {
|
||||||
warn!(context, 0, "SMTP ***************** CONNECT");
|
info!(context, 0, "SMTP ***************** CONNECT");
|
||||||
unsafe {
|
|
||||||
dc_log_event(
|
|
||||||
context,
|
|
||||||
Event::INFO,
|
|
||||||
0,
|
|
||||||
b"SMTP ***************************************************** connect starts" as *const u8 as *const libc::c_char,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if lp.is_null() {
|
if lp.is_null() {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user