remove queued push keys on pusher deletion, use more refs

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-11-23 13:45:27 -05:00
parent 9d23a2b6f5
commit 3fe98f35f2
No known key found for this signature in database
4 changed files with 48 additions and 18 deletions

View file

@ -79,26 +79,24 @@ impl Service {
///
/// # Arguments
///
/// * `service_name` - the name you send to register the service previously
pub async fn unregister_appservice(&self, service_name: &str) -> Result<()> {
/// * `service_name` - the registration ID of the appservice
pub async fn unregister_appservice(&self, appservice_id: &str) -> Result<()> {
// removes the appservice registration info
self.registration_info
.write()
.await
.remove(service_name)
.remove(appservice_id)
.ok_or(err!("Appservice not found"))?;
// remove the appservice from the database
self.db.id_appserviceregistrations.remove(service_name);
self.db.id_appserviceregistrations.del(appservice_id);
// deletes all active requests for the appservice if there are any so we stop
// sending to the URL
self.services
.sending
.cleanup_events(service_name.to_owned())
.await;
Ok(())
.cleanup_events(Some(appservice_id), None, None)
.await
}
pub async fn get_registration(&self, id: &str) -> Option<Registration> {