Refactoring
This commit is contained in:
@@ -150,13 +150,13 @@ class Relay(
|
|||||||
val onConnected: (Relay) -> Unit,
|
val onConnected: (Relay) -> Unit,
|
||||||
) : WebSocketListener {
|
) : WebSocketListener {
|
||||||
override fun onOpen(
|
override fun onOpen(
|
||||||
pingInMs: Long,
|
pingMillis: Long,
|
||||||
usingCompression: Boolean,
|
compression: Boolean,
|
||||||
) {
|
) {
|
||||||
checkNotInMainThread()
|
checkNotInMainThread()
|
||||||
Log.d("Relay", "Connect onOpen $url $socket")
|
Log.d("Relay", "Connect onOpen $url $socket")
|
||||||
|
|
||||||
markConnectionAsReady(pingInMs, usingCompression)
|
markConnectionAsReady(pingMillis, compression)
|
||||||
|
|
||||||
// Log.w("Relay", "Relay OnOpen, Loading All subscriptions $url")
|
// Log.w("Relay", "Relay OnOpen, Loading All subscriptions $url")
|
||||||
onConnected(this@Relay)
|
onConnected(this@Relay)
|
||||||
|
|||||||
+2
-2
@@ -85,9 +85,9 @@ import com.vitorpamplona.amethyst.commons.robohash.parts.mouth6Cell
|
|||||||
import com.vitorpamplona.amethyst.commons.robohash.parts.mouth7Happy
|
import com.vitorpamplona.amethyst.commons.robohash.parts.mouth7Happy
|
||||||
import com.vitorpamplona.amethyst.commons.robohash.parts.mouth8Buttons
|
import com.vitorpamplona.amethyst.commons.robohash.parts.mouth8Buttons
|
||||||
import com.vitorpamplona.amethyst.commons.robohash.parts.mouth9Closed
|
import com.vitorpamplona.amethyst.commons.robohash.parts.mouth9Closed
|
||||||
|
import com.vitorpamplona.quartz.crypto.CryptoUtils
|
||||||
import com.vitorpamplona.quartz.encoders.Hex
|
import com.vitorpamplona.quartz.encoders.Hex
|
||||||
import com.vitorpamplona.quartz.encoders.HexValidator
|
import com.vitorpamplona.quartz.encoders.HexValidator
|
||||||
import java.security.MessageDigest
|
|
||||||
|
|
||||||
val Black = SolidColor(Color.Black)
|
val Black = SolidColor(Color.Black)
|
||||||
val Gray = SolidColor(Color(0xFF6d6e70))
|
val Gray = SolidColor(Color(0xFF6d6e70))
|
||||||
@@ -169,7 +169,7 @@ class RobohashAssembler {
|
|||||||
Hex.decode(msg)
|
Hex.decode(msg)
|
||||||
} else {
|
} else {
|
||||||
Log.w("Robohash", "$msg is not a hex")
|
Log.w("Robohash", "$msg is not a hex")
|
||||||
MessageDigest.getInstance("SHA-256").digest(msg.toByteArray())
|
CryptoUtils.sha256(msg.toByteArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
val bgColor = SolidColor(bytesToColor(hash[0], hash[1], hash[2], isLightTheme))
|
val bgColor = SolidColor(bytesToColor(hash[0], hash[1], hash[2], isLightTheme))
|
||||||
|
|||||||
Reference in New Issue
Block a user