|
|
|
|
@ -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) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|