Commit 08142dce authored by Leonardo Aramaki's avatar Leonardo Aramaki

Show recent custom emojis only if it pertains to the current server

parent 8ee1100c
......@@ -214,7 +214,17 @@ object EmojiRepository {
val recentShortnames = recentsJson.keys()
for (i in 0 until len) {
val shortname = recentShortnames.next()
allEmojis.firstOrNull { it.shortname == shortname }?.let {
allEmojis.firstOrNull {
if (it.shortname == shortname) {
if (it.isCustom()) {
return@firstOrNull getCurrentServerUrl()?.let { url ->
it.url?.startsWith(url)
} ?: false
}
return@firstOrNull true
}
false
}?.let {
val useCount = recentsJson.getInt(it.shortname)
list.add(it.copy(count = useCount))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment