Skip to content

Commit

Permalink
chore: rename websocketUpdater (#21)
Browse files Browse the repository at this point in the history
* chore: rename `websocketUpdater`
lnbits/lnbits#2377
  • Loading branch information
dni authored Apr 12, 2024
1 parent 43eed0d commit 349bfa4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"short_description": "One click launch your own relay!",
"tile": "/nostrrelay/static/image/nostrrelay.png",
"contributors": ["arcbtc", "DCs"],
"min_lnbits_version": "0.11.0"
"min_lnbits_version": "0.12.6"
}
10 changes: 5 additions & 5 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from loguru import logger

from lnbits.core.models import Payment
from lnbits.core.services import websocketUpdater
from lnbits.core.services import websocket_updater
from lnbits.helpers import get_current_extension_name
from lnbits.tasks import register_invoice_listener

Expand Down Expand Up @@ -32,13 +32,13 @@ async def on_invoice_paid(payment: Payment):
if not relay_id or not pubkey:
message = f"Invoice extra data missing for 'relay_id' and 'pubkey'. Payment hash: {hash}"
logger.warning(message)
await websocketUpdater(hash, json.dumps({"success": False, "message": message}))
await websocket_updater(hash, json.dumps({"success": False, "message": message}))
return

action = payment.extra.get("action")
if action == "join":
await invoice_paid_to_join(relay_id, pubkey, payment.amount)
await websocketUpdater(hash, json.dumps({"success": True}))
await websocket_updater(hash, json.dumps({"success": True}))
return

if action == "storage":
Expand All @@ -50,10 +50,10 @@ async def on_invoice_paid(payment: Payment):
logger.warning(message)
return
await invoice_paid_for_storage(relay_id, pubkey, storage_to_buy, payment.amount)
await websocketUpdater(hash, json.dumps({"success": True}))
await websocket_updater(hash, json.dumps({"success": True}))
return

await websocketUpdater(
await websocket_updater(
hash, json.dumps({"success": False, "message": f"Bad action name: '{action}'"})
)

Expand Down

0 comments on commit 349bfa4

Please sign in to comment.