Implement new APIs for Boost badging.

This commit is contained in:
Alex Hart
2021-10-28 09:11:45 -03:00
committed by Greyson Parrelli
parent 48a81da883
commit 186bd9db48
19 changed files with 457 additions and 137 deletions

View File

@@ -23,7 +23,7 @@ class BadgeRepository(context: Context) {
fun setFeaturedBadge(featuredBadge: Badge): Completable = Completable.fromAction {
val badges = Recipient.self().badges
val reOrderedBadges = listOf(featuredBadge) + (badges - featuredBadge)
val reOrderedBadges = listOf(featuredBadge.copy(visible = true)) + (badges.filterNot { it.id == featuredBadge.id })
ProfileUtil.uploadProfileWithBadges(context, reOrderedBadges)
val recipientDatabase: RecipientDatabase = DatabaseFactory.getRecipientDatabase(context)