Adds checks for the main thread when parsing NIP30

This commit is contained in:
Vitor Pamplona 2023-06-22 17:41:11 -04:00
parent 7d7f047f55
commit fbb1b59e34

View File

@ -6,6 +6,8 @@ class NIP30Parser {
val customEmojiPattern: Pattern = Pattern.compile("\\:([A-Za-z0-9_\\-]+)\\:", Pattern.CASE_INSENSITIVE)
fun buildArray(input: String): List<String> {
checkNotInMainThread()
val matcher = customEmojiPattern.matcher(input)
val list = mutableListOf<String>()
while (matcher.find()) {