From 4272d64961d5d294d84fa35fc258f85388d4aa8c Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 27 Mar 2023 21:41:03 -0500 Subject: [PATCH] Onboarding gets the full command UI link This is because they really aren't using the bot, but sending the big link to everyone is not only ugly, but at least in gajim it makes the link not do anything. Ideally we'd do something with pushed command list or xhtml-im or fallback bodies, but using whispers makes that not easy at the moment, and we use whispers because new customers don't have a cheogram route set yet. --- bin/process_pending_btc_transactions | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/process_pending_btc_transactions b/bin/process_pending_btc_transactions index 018c9fc115d91ebcc67ee28ac6f85489c4ece156..bae2cbacf3341cb20749fa666ea4ea6fa23e2cf3 100755 --- a/bin/process_pending_btc_transactions +++ b/bin/process_pending_btc_transactions @@ -134,8 +134,12 @@ class Plan def notify_approved @customer.notify( "Your JMP account has been approved. To complete " \ - "your signup, click/tap here: xmpp:cheogram.com " \ - "and send register jmp.chat to the bot." + "your signup, click/tap this link: xmpp:cheogram.com " \ + "and send register jmp.chat to the bot.", + "Your JMP account has been approved. To complete " \ + "your signup, click/tap this link: " \ + "xmpp:cheogram.com/CHEOGRAM%25jabber%3Aiq%3Aregister" \ + "?command;node=jabber%3Aiq%3Aregister" ) end end @@ -150,10 +154,14 @@ class Customer @customer_id end - def notify(body) + def notify(body, onboarding_body=nil) jid = REDIS.get("jmp_customer_jid-#{@customer_id}") raise "No JID for #{customer_id}" unless jid + if jid =~ /onboarding.cheogram.com/ && onboarding_body + body = onboarding_body + end + BlatherNotify.say( CONFIG[:notify_using][:target].call(jid), CONFIG[:notify_using][:body].call(jid, body)