diff --git a/src/helpers/account_helper.rs b/src/helpers/account_helper.rs index fbc1b69..fdf7b2b 100644 --- a/src/helpers/account_helper.rs +++ b/src/helpers/account_helper.rs @@ -14,7 +14,7 @@ use crate::data::new_notifications_settings::NewNotificationsSettings; use crate::data::security_settings::SecuritySettings; use crate::data::user::{AccountImageVisibility, User, UserID, UserPageStatus}; use crate::data::user_token::{PushNotificationToken, UserAccessToken}; -use crate::helpers::{comments_helper, conversations_helper, custom_emojies_helper, database, events_helper, friends_helper, groups_helper, likes_helper, notifications_helper, posts_helper, push_notifications_helper, survey_helper, user_helper}; +use crate::helpers::{comments_helper, conversations_helper, custom_emojies_helper, database, events_helper, forez_presence_helper, friends_helper, groups_helper, likes_helper, notifications_helper, posts_helper, push_notifications_helper, survey_helper, user_helper}; use crate::helpers::database::{DeleteQuery, InsertQuery, QueryInfo, RowResult, UpdateInfo}; use crate::helpers::events_helper::Event; use crate::helpers::likes_helper::LikeType; @@ -397,6 +397,9 @@ pub fn delete(user_id: &UserID) -> ResultBoxError { // Delete all custom user emojies custom_emojies_helper::delete_all_user(user_id)?; + // Delete all forez presences + forez_presence_helper::delete_all_user(user_id)?; + // Delete connections to all services destroy_all_user_tokens(user_id)?; diff --git a/src/helpers/forez_presence_helper.rs b/src/helpers/forez_presence_helper.rs index a33d58d..f89a221 100644 --- a/src/helpers/forez_presence_helper.rs +++ b/src/helpers/forez_presence_helper.rs @@ -24,6 +24,13 @@ pub fn get_user_presences(group_id: &GroupID, user_id: &UserID) -> Res Res { + database::DeleteQuery::new(FOREZ_PRESENCE_TABLE) + .cond_user_id("user_id", user_id) + .exec() +} + /// Update the presences of a user pub fn update(group_id: &GroupID, user_id: &UserID, list: Vec) -> Res { let previous_presences = get_user_presences(group_id, user_id)?;