Uses Lists name instead of d-tag on the Top Bar
This commit is contained in:
@@ -595,7 +595,7 @@ class ResourceName(val resourceId: Int, val context: Context) : Name() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PeopleListName(val note: AddressableNote) : Name() {
|
class PeopleListName(val note: AddressableNote) : Name() {
|
||||||
override fun name() = note.dTag() ?: ""
|
override fun name() = (note.event as? PeopleListEvent)?.nameOrTitle() ?: note.dTag() ?: ""
|
||||||
}
|
}
|
||||||
class CommunityName(val note: AddressableNote) : Name() {
|
class CommunityName(val note: AddressableNote) : Name() {
|
||||||
override fun name() = "/n/${(note.dTag() ?: "")}"
|
override fun name() = "/n/${(note.dTag() ?: "")}"
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ abstract class GeneralListEvent(
|
|||||||
fun bookmarkedPosts() = taggedEvents()
|
fun bookmarkedPosts() = taggedEvents()
|
||||||
fun bookmarkedPeople() = taggedUsers()
|
fun bookmarkedPeople() = taggedUsers()
|
||||||
|
|
||||||
|
fun name() = tags.firstOrNull { it.size > 1 && it[0] == "name" }?.get(1)
|
||||||
|
fun title() = tags.firstOrNull { it.size > 1 && it[0] == "title" }?.get(1)
|
||||||
|
fun nameOrTitle() = name() ?: title()
|
||||||
|
|
||||||
fun plainContent(privKey: ByteArray): String? {
|
fun plainContent(privKey: ByteArray): String? {
|
||||||
if (content.isBlank()) return null
|
if (content.isBlank()) return null
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user