mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-22 06:31:36 +02:00
Making tags case insensitive
This commit is contained in:
@@ -330,7 +330,7 @@ class Account(
|
|||||||
if (contactList != null && (followingUsers.isNotEmpty() || followingTags.isNotEmpty())) {
|
if (contactList != null && (followingUsers.isNotEmpty() || followingTags.isNotEmpty())) {
|
||||||
val event = ContactListEvent.create(
|
val event = ContactListEvent.create(
|
||||||
followingUsers,
|
followingUsers,
|
||||||
followingTags.filter { it != tag },
|
followingTags.filter { !it.equals(tag, ignoreCase = true) },
|
||||||
contactList.relays(),
|
contactList.relays(),
|
||||||
loggedIn.privKey!!
|
loggedIn.privKey!!
|
||||||
)
|
)
|
||||||
|
@@ -257,6 +257,12 @@ class User(val pubkeyHex: String) {
|
|||||||
} ?: false
|
} ?: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun isFollowingHashtagCached(tag: String): Boolean {
|
||||||
|
return latestContactList?.verifiedFollowTagSet?.let {
|
||||||
|
return tag.lowercase() in it
|
||||||
|
} ?: false
|
||||||
|
}
|
||||||
|
|
||||||
fun isFollowingCached(user: User): Boolean {
|
fun isFollowingCached(user: User): Boolean {
|
||||||
return latestContactList?.verifiedFollowKeySet?.let {
|
return latestContactList?.verifiedFollowKeySet?.let {
|
||||||
return user.pubkeyHex in it
|
return user.pubkeyHex in it
|
||||||
|
@@ -107,7 +107,7 @@ fun HashtagHeader(tag: String, account: Account) {
|
|||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (userFollows.isFollowingHashtag(tag)) {
|
if (userFollows.isFollowingHashtagCached(tag)) {
|
||||||
UnfollowButton { coroutineScope.launch(Dispatchers.IO) { account.unfollow(tag) } }
|
UnfollowButton { coroutineScope.launch(Dispatchers.IO) { account.unfollow(tag) } }
|
||||||
} else {
|
} else {
|
||||||
FollowButton { coroutineScope.launch(Dispatchers.IO) { account.follow(tag) } }
|
FollowButton { coroutineScope.launch(Dispatchers.IO) { account.follow(tag) } }
|
||||||
|
Reference in New Issue
Block a user