mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
also remove user styles when removing old chat messages
This commit is contained in:
parent
96e55732b4
commit
1b3a67ff5f
3 changed files with 10 additions and 6 deletions
|
|
@ -152,7 +152,7 @@ android {
|
|||
buildConfigField "String", "STORE", "\"google\""
|
||||
multiDexEnabled true
|
||||
|
||||
versionCode 2093
|
||||
versionCode 2096
|
||||
versionName "1.9"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ package com.habitrpg.android.habitica.data.local.implementation
|
|||
|
||||
import com.habitrpg.android.habitica.data.local.SocialLocalRepository
|
||||
import com.habitrpg.android.habitica.models.members.Member
|
||||
import com.habitrpg.android.habitica.models.social.ChatMessage
|
||||
import com.habitrpg.android.habitica.models.social.ChatMessageLike
|
||||
import com.habitrpg.android.habitica.models.social.Group
|
||||
import com.habitrpg.android.habitica.models.social.GroupMembership
|
||||
import com.habitrpg.android.habitica.models.social.*
|
||||
import com.habitrpg.android.habitica.models.user.ContributorInfo
|
||||
import com.habitrpg.android.habitica.models.user.User
|
||||
import io.reactivex.Flowable
|
||||
import io.realm.Realm
|
||||
|
|
@ -211,10 +209,15 @@ class RealmSocialLocalRepository(realm: Realm) : RealmBaseLocalRepository(realm)
|
|||
messagesToRemove.add(existingMessage)
|
||||
}
|
||||
}
|
||||
val idsToRemove = messagesToRemove.map { it.id }
|
||||
val userStylestoRemove = realm.where(UserStyles::class.java).`in`("id", idsToRemove.toTypedArray()).findAll()
|
||||
val contributorToRemove = realm.where(ContributorInfo::class.java).`in`("id", idsToRemove.toTypedArray()).findAll()
|
||||
realm.executeTransaction {
|
||||
for (member in messagesToRemove) {
|
||||
member.deleteFromRealm()
|
||||
}
|
||||
userStylestoRemove.deleteAllFromRealm()
|
||||
contributorToRemove.deleteAllFromRealm()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
- Redesigned Class selection
|
||||
- Redesigned Task Form
|
||||
- Redesigned Report message dialog
|
||||
- Optimized user and content loading
|
||||
- Improved FAQ and settings
|
||||
|
||||
- Fixed Time Travelers shop display
|
||||
|
|
|
|||
Loading…
Reference in a new issue