Compare commits
No commits in common. "main" and "garbage" have entirely different histories.
4 changed files with 6 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "mention_2_mail"
|
||||
version = "0.2.1"
|
||||
version = "0.2.0"
|
||||
authors = ["Thelie <git.daniel@mowitz.rocks>"]
|
||||
edition = "2018"
|
||||
|
||||
|
@ -8,7 +8,7 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
irc-proto = "0.15"
|
||||
irc_stream = { path = "irc-stream", version = "0.2" }
|
||||
irc_stream = { path = "irc-stream", version = "0.1" }
|
||||
lettre = "0.9"
|
||||
lettre_email = "0.9"
|
||||
native-tls = "0.2"
|
||||
|
|
|
@ -66,13 +66,6 @@ fn parse_server_dir(mut config: Value, server_config_path: PathBuf)
|
|||
config = merge_config_maps(config, client_config)?;
|
||||
},
|
||||
"channels.toml" => {
|
||||
let channels = Value::from(parse_toml_to_table(entry.path())?);
|
||||
if config.contains_key(&"channels".to_owned()) {
|
||||
config[&"channels".to_owned()] = channels;
|
||||
} else {
|
||||
config.insert("channels".to_owned(), channels);
|
||||
}
|
||||
|
||||
let channel_config = parse_toml_to_table(entry.path())?;
|
||||
config = merge_config_maps(config, channel_config)?;
|
||||
},
|
||||
|
|
|
@ -27,16 +27,15 @@ use std::{
|
|||
thread,
|
||||
};
|
||||
use lettre::{
|
||||
Transport,
|
||||
SmtpClient,
|
||||
smtp::authentication::{
|
||||
Credentials,
|
||||
Mechanism,
|
||||
},
|
||||
Transport,
|
||||
};
|
||||
use lettre_email::EmailBuilder;
|
||||
|
||||
|
||||
fn main() {
|
||||
let mut server_conf_flag = false;
|
||||
let mut config_path = None;
|
||||
|
@ -76,13 +75,11 @@ fn main() {
|
|||
|
||||
// TODO: This line has many problems…
|
||||
let (tx,rx): (std::sync::mpsc::Sender<(String, String, String, Vec<Option<[String; 2]>>)>, std::sync::mpsc::Receiver<(String, String, String, Vec<Option<[String; 2]>>)>)= channel();
|
||||
|
||||
let mut server_threads = vec![];
|
||||
|
||||
for s_conf in server_configs {
|
||||
let t = tx.clone();
|
||||
|
||||
let addr = s_conf.get("server").unwrap().as_str()
|
||||
let addr = s_conf.get("server").unwrap().as_str()
|
||||
.ok_or("Could not get server adress from config").unwrap();
|
||||
server_threads.push(thread::Builder::new()
|
||||
.name(addr.to_string())
|
||||
|
|
|
@ -269,7 +269,7 @@ pub fn handle_server
|
|||
// Handle all incoming messages after joining the channels.
|
||||
loop {
|
||||
let message = stream.read()?;
|
||||
let (answer, data) = handle_message(
|
||||
let (answer, data) = handle_message(
|
||||
message,
|
||||
&nick,
|
||||
clients.keys(),
|
||||
|
@ -281,7 +281,7 @@ pub fn handle_server
|
|||
None => ()
|
||||
}
|
||||
match data {
|
||||
Some((client, channel, context)) => match clients.get(&client) {
|
||||
Some((client, channel, context)) => match clients.get(&client) {
|
||||
Some(addr) => {
|
||||
let out = (
|
||||
addr.as_str()
|
||||
|
|
Loading…
Reference in a new issue