Skip to content

Commit

Permalink
chore: rename websocketUpdater (#16)
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 38360f4 commit ddcf6f9
Show file tree
Hide file tree
Showing 3 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,6 +3,6 @@
"short_description": "Video tips/animations/webhooks",
"tile": "/copilot/static/bitcoin-streaming.png",
"contributors": ["arcbtc"],
"min_lnbits_version": "0.11.0",
"min_lnbits_version": "0.12.6",
"is_installed": true
}
6 changes: 3 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from lnbits.core import db as core_db
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 @@ -65,11 +65,11 @@ async def on_invoice_paid(payment: Payment) -> None:
except (httpx.ConnectError, httpx.RequestError):
await mark_webhook_sent(payment, -1)
if payment.extra.get("comment"):
await websocketUpdater(
await websocket_updater(
copilot.id, str(data) + "-" + str(payment.extra.get("comment"))
)

await websocketUpdater(copilot.id, str(data) + "-none")
await websocket_updater(copilot.id, str(data) + "-none")


async def mark_webhook_sent(payment: Payment, status: int) -> None:
Expand Down
4 changes: 2 additions & 2 deletions views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from fastapi import Depends, Request
from fastapi.exceptions import HTTPException

from lnbits.core.services import websocketUpdater
from lnbits.core.services import websocket_updater
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key

from . import copilot_ext
Expand Down Expand Up @@ -97,7 +97,7 @@ async def api_copilot_ws_relay(copilot_id: str, comment: str, data: str):
status_code=HTTPStatus.NOT_FOUND, detail="Copilot does not exist"
)
try:
await websocketUpdater(copilot_id, str(data) + "-" + str(comment))
await websocket_updater(copilot_id, str(data) + "-" + str(comment))
except:
raise HTTPException(status_code=HTTPStatus.FORBIDDEN, detail="Not your copilot")
return ""

0 comments on commit ddcf6f9

Please sign in to comment.