This commit is contained in:
Taylor C. Richberger 2020-04-17 16:54:07 -06:00
parent b30eec72b3
commit f129f45864
1 changed files with 2 additions and 0 deletions

View File

@ -57,6 +57,7 @@ impl DiceBot {
} }
pub async fn sync(&mut self) -> Result<(), Box<dyn std::error::Error>> { pub async fn sync(&mut self) -> Result<(), Box<dyn std::error::Error>> {
// TODO: handle http 429
let mut url = format!("https://{}/_matrix/client/r0/sync?access_token={}&timeout=3000", let mut url = format!("https://{}/_matrix/client/r0/sync?access_token={}&timeout=3000",
self.config.matrix.home_server, self.config.matrix.home_server,
self.access_token); self.access_token);
@ -75,6 +76,7 @@ impl DiceBot {
} }
pub async fn logout(self) -> Result<(), Box<dyn std::error::Error>> { pub async fn logout(self) -> Result<(), Box<dyn std::error::Error>> {
// TODO: Write out next_batch
self.client.post(&format!("https://{}/_matrix/client/r0/logout?access_token={}", self.config.matrix.home_server, self.access_token)) self.client.post(&format!("https://{}/_matrix/client/r0/logout?access_token={}", self.config.matrix.home_server, self.access_token))
.body("{}") .body("{}")
.send() .send()