Add Webhooks and XMPP notifications for incoming sats #79
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/webhooks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ln_login
out of encrypted column toln_account
, so we can look up users by loginsend_message
API to ejabberd service, plus respective background jobWIP: Add Webhooks and XMPP notifications for incoming satsto Add Webhooks and XMPP notifications for incoming satsthat's super cool!
from checking the code it looks good to me.
I have a few minor comments
@ -0,0 +5,4 @@
def lndhub
begin
payload = JSON.parse(request.body.read, symbolize_names: true)
doesn't rails automatically parse the JSON because the proper content type is set?
so
params[:type]
andparams[:user_login]
should be enough?I didn't know, so I tried (also with explicitly setting the content type in the spec). Doesn't do it.
@ -0,0 +11,4 @@
head :unprocessable_entity and return
end
user = User.find_by(ln_account: payload[:user_login])
should not be the case, but this might be nil. maybe we should do a
User.find_by!
Good idea! Fails much cleaner and more expressively than when trying to access properties on
nil
later.