♻️ Add Room domain entity

This commit is contained in:
2024-04-10 13:39:45 +02:00
parent a7bccfa779
commit c580fba315
8 changed files with 447 additions and 339 deletions

View File

@@ -37,8 +37,11 @@ impl Requester {
pub async fn init(&self) -> anyhow::Result<()> {
let (reply, mut response) = oneshot();
// TODO: Handle error case.
self.tx.send(WorkerTask::Init(reply)).unwrap();
if let Err(err) = self.tx.send(WorkerTask::Init(reply)) {
let msg = format!("Unable to request the init of the Matrix client: {err}");
return Err(anyhow::Error::msg(msg));
}
match response.recv().await {
Some(result) => Ok(result),
None => Err(anyhow::Error::msg("TBD")),
@@ -48,8 +51,11 @@ impl Requester {
pub async fn login(&self, style: LoginStyle) -> anyhow::Result<()> {
let (reply, mut response) = oneshot();
// TODO: Handle error case.
self.tx.send(WorkerTask::Login(style, reply)).unwrap();
if let Err(err) = self.tx.send(WorkerTask::Login(style, reply)) {
let msg = format!("Unable to request login to the Matrix client: {err}");
return Err(anyhow::Error::msg(msg));
}
match response.recv().await {
Some(result) => result,
None => Err(anyhow::Error::msg("TBD")),