Browse Source

delete conversations cache on logout (#4997)

pull/5004/head
Konrad Pozniak 1 year ago committed by GitHub
parent
commit
6c446ebb26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      app/src/main/java/com/keylesspalace/tusky/db/DatabaseCleaner.kt

5
app/src/main/java/com/keylesspalace/tusky/db/DatabaseCleaner.kt

@ -16,6 +16,7 @@
package com.keylesspalace.tusky.db
import androidx.room.withTransaction
import com.keylesspalace.tusky.components.conversation.ConversationEntity
import com.keylesspalace.tusky.db.entity.HomeTimelineEntity
import com.keylesspalace.tusky.db.entity.NotificationEntity
import com.keylesspalace.tusky.db.entity.NotificationReportEntity
@ -49,7 +50,8 @@ class DatabaseCleaner @Inject constructor(
}
/**
* Deletes everything from the [HomeTimelineEntity], [TimelineStatusEntity], [TimelineAccountEntity], [NotificationEntity] and [NotificationReportEntity] tables for one user.
* Deletes everything from the [HomeTimelineEntity], [TimelineStatusEntity], [TimelineAccountEntity],
* [NotificationEntity], [NotificationReportEntity] and [ConversationEntity] tables for one user.
* Intended to be used when a user logs out.
* @param tuskyAccountId id of the account for which to clean tables
*/
@ -61,6 +63,7 @@ class DatabaseCleaner @Inject constructor(
db.timelineDao().removeAllHomeTimelineItems(tuskyAccountId)
db.timelineStatusDao().removeAllStatuses(tuskyAccountId)
db.timelineAccountDao().removeAllAccounts(tuskyAccountId)
db.conversationDao().deleteForAccount(tuskyAccountId)
}
}
}

Loading…
Cancel
Save