Skip to content

Commit

Permalink
Fix incompatibility with dxr_client 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDaemoness committed Dec 5, 2024
1 parent 1868c04 commit 5c919fd
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/xmlrpc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dxr_client::{Call, Client, ClientBuilder};
use dxr_client::{Client, ClientBuilder, ClientError};
use url::Url;

pub struct Xmlrpc {
Expand All @@ -11,23 +11,23 @@ impl Xmlrpc {
}
}

fn request<'a>(
async fn request<'a>(
&self,
service: &'static str,
command: &'static str,
params: Vec<&'a str>,
) -> Call<'a, Vec<&'a str>, String> {
Call::new(
"atheme.command",
[vec!["", "", "127.0.0.1", service, command], params].concat(),
)
) -> Result<(), ClientError> {
self.client
.call(
"atheme.command",
[vec!["", "", "127.0.0.1", service, command], params].concat(),
)
.await
}

pub async fn verify(&self, account: &str, token: &str) -> Result<(), String> {
let request = Xmlrpc::request("NickServ", "VERIFY", vec!["REGISTER", account, token]);
self.client
.call(request)
self.request("NickServ", "VERIFY", vec!["REGISTER", account, token])
.await
.map(|_| ())
.map_err(|e| format!("{e:?}"))
}
}

0 comments on commit 5c919fd

Please sign in to comment.