mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-19 10:31:07 +02:00
Makes sure the account is writeable before signing Auth for notifications
This commit is contained in:
@@ -23,7 +23,7 @@ class RegisterAccounts(
|
|||||||
): List<RelayAuthEvent> {
|
): List<RelayAuthEvent> {
|
||||||
return accounts.mapNotNull {
|
return accounts.mapNotNull {
|
||||||
val acc = LocalPreferences.loadFromEncryptedStorage(it.npub)
|
val acc = LocalPreferences.loadFromEncryptedStorage(it.npub)
|
||||||
if (acc != null) {
|
if (acc != null && acc.isWriteable()) {
|
||||||
val relayToUse = acc.activeRelays()?.firstOrNull { it.read }
|
val relayToUse = acc.activeRelays()?.firstOrNull { it.read }
|
||||||
if (relayToUse != null) {
|
if (relayToUse != null) {
|
||||||
acc.createAuthEvent(relayToUse, notificationToken)
|
acc.createAuthEvent(relayToUse, notificationToken)
|
||||||
|
Reference in New Issue
Block a user