matrix: login_and_sync does not need to be generic
This commit is contained in:
@ -57,7 +57,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
// This message passing channel is used for sending messages to the matrix module,
|
// This message passing channel is used for sending messages to the matrix module,
|
||||||
// it holds a tuple with an HTML message and a list of rooms to post to
|
// it holds a tuple with an HTML message and a list of rooms to post to
|
||||||
let (bcast_tx, bcast_rx) = broadcast::channel(1024);
|
let (bcast_tx, bcast_rx) = broadcast::channel::<(String, Vec<String>)>(1024);
|
||||||
|
|
||||||
let handles: Vec<JoinHandle<_>> = config.feeds.clone().into_iter().map(|feed_config| {
|
let handles: Vec<JoinHandle<_>> = config.feeds.clone().into_iter().map(|feed_config| {
|
||||||
let state_db = Arc::clone(&state_db);
|
let state_db = Arc::clone(&state_db);
|
||||||
@ -131,7 +131,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
})
|
})
|
||||||
}).collect();
|
}).collect();
|
||||||
|
|
||||||
login_and_sync::<(String, Vec<String>)>(
|
login_and_sync(
|
||||||
config.homeserver_uri.clone().into(),
|
config.homeserver_uri.clone().into(),
|
||||||
&config.username,
|
&config.username,
|
||||||
&config.password,
|
&config.password,
|
||||||
|
@ -85,7 +85,7 @@ async fn send_to_room(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn login_and_sync<T: Clone>(
|
pub async fn login_and_sync(
|
||||||
homeserver_url: String,
|
homeserver_url: String,
|
||||||
username: &str,
|
username: &str,
|
||||||
password: &str,
|
password: &str,
|
||||||
|
Reference in New Issue
Block a user