mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-29 11:11:44 +01:00
Adding a geohash mipmap to events.
This commit is contained in:
parent
d1bef11f88
commit
0de4cd5c18
@ -62,7 +62,7 @@ class ChannelMessageEvent(
|
||||
tags.add(listOf("zapraiser", "$it"))
|
||||
}
|
||||
geohash?.let {
|
||||
tags.add(listOf("g", it))
|
||||
tags.addAll(geohashMipMap(it))
|
||||
}
|
||||
|
||||
signer.sign(createdAt, kind, tags, content, onReady)
|
||||
|
@ -84,7 +84,7 @@ class ChatMessageEvent(
|
||||
tags.add(listOf("zapraiser", "$it"))
|
||||
}
|
||||
geohash?.let {
|
||||
tags.add(listOf("g", it))
|
||||
tags.addAll(geohashMipMap(it))
|
||||
}
|
||||
subject?.let {
|
||||
tags.add(listOf("subject", it))
|
||||
|
@ -78,7 +78,7 @@ class LiveActivitiesChatMessageEvent(
|
||||
tags.add(listOf("zapraiser", "$it"))
|
||||
}
|
||||
geohash?.let {
|
||||
tags.add(listOf("g", it))
|
||||
tags.addAll(geohashMipMap(it))
|
||||
}
|
||||
|
||||
signer.sign(createdAt, kind, tags, content, onReady)
|
||||
|
@ -97,7 +97,7 @@ class PollNoteEvent(
|
||||
tags.add(listOf("zapraiser", "$it"))
|
||||
}
|
||||
geohash?.let {
|
||||
tags.add(listOf("g", it))
|
||||
tags.addAll(geohashMipMap(it))
|
||||
}
|
||||
|
||||
signer.sign(createdAt, kind, tags, msg, onReady)
|
||||
|
@ -129,7 +129,7 @@ class PrivateDmEvent(
|
||||
tags.add(listOf("zapraiser", "$it"))
|
||||
}
|
||||
geohash?.let {
|
||||
tags.add(listOf("g", it))
|
||||
tags.addAll(geohashMipMap(it))
|
||||
}
|
||||
|
||||
signer.nip04Encrypt(message, recipientPubKey) { content ->
|
||||
@ -138,3 +138,9 @@ class PrivateDmEvent(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun geohashMipMap(geohash: String): List<List<String>> {
|
||||
return geohash.indices.asSequence().map {
|
||||
listOf("g", geohash.substring(0, it+1))
|
||||
}.toList().reversed()
|
||||
}
|
@ -94,7 +94,7 @@ class TextNoteEvent(
|
||||
tags.add(listOf("zapraiser", "$it"))
|
||||
}
|
||||
geohash?.let {
|
||||
tags.add(listOf("g", it))
|
||||
tags.addAll(geohashMipMap(it))
|
||||
}
|
||||
|
||||
signer.sign(createdAt, kind, tags, msg, onReady)
|
||||
|
Loading…
x
Reference in New Issue
Block a user