Deleting contact lists from pausing the app
This commit is contained in:
@@ -71,6 +71,7 @@ object ServiceManager {
|
|||||||
account?.let {
|
account?.let {
|
||||||
LocalCache.pruneOldAndHiddenMessages(it)
|
LocalCache.pruneOldAndHiddenMessages(it)
|
||||||
LocalCache.pruneHiddenMessages(it)
|
LocalCache.pruneHiddenMessages(it)
|
||||||
|
LocalCache.pruneContactLists(it)
|
||||||
// LocalCache.pruneNonFollows(it)
|
// LocalCache.pruneNonFollows(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -708,6 +708,18 @@ object LocalCache {
|
|||||||
println("PRUNE: ${toBeRemoved.size} messages removed because they were Hidden")
|
println("PRUNE: ${toBeRemoved.size} messages removed because they were Hidden")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun pruneContactLists(userAccount: Account) {
|
||||||
|
var removingContactList = 0
|
||||||
|
users.values.forEach {
|
||||||
|
if (it != userAccount.userProfile() && (it.liveSet == null || it.liveSet?.isInUse() == false)) {
|
||||||
|
it.latestContactList = null
|
||||||
|
removingContactList++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println("PRUNE: $removingContactList contact lists")
|
||||||
|
}
|
||||||
|
|
||||||
// Observers line up here.
|
// Observers line up here.
|
||||||
val live: LocalCacheLiveData = LocalCacheLiveData(this)
|
val live: LocalCacheLiveData = LocalCacheLiveData(this)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user