mirror of https://github.com/usbharu/Hideout.git
feat: 絵文字を識別するIDの生成を追加
This commit is contained in:
parent
b070b8c71d
commit
80f4e9fb04
|
@ -5,6 +5,7 @@ import java.time.Instant
|
|||
sealed class Emoji {
|
||||
abstract val domain: String
|
||||
abstract val name: String
|
||||
abstract fun id(): String
|
||||
}
|
||||
|
||||
data class CustomEmoji(
|
||||
|
@ -15,10 +16,17 @@ data class CustomEmoji(
|
|||
val url: String,
|
||||
val category: String,
|
||||
val createdAt: Instant
|
||||
) : Emoji()
|
||||
) : Emoji() {
|
||||
override fun id(): String {
|
||||
return id.toString()
|
||||
}
|
||||
}
|
||||
|
||||
data class UnicodeEmoji(
|
||||
override val name: String
|
||||
) : Emoji() {
|
||||
override val domain: String = "unicode.org"
|
||||
override fun id(): String {
|
||||
return name
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue