~singpolyma/cheogram

cheogram/ConfigureDirectMessageRoute.hs -rw-r--r-- 24.9 KiB
Change JID Command

If the backend sends us a command we recognize as a JID change, we
intercept it and replace it with ours.

Ours asks which JID we want to move to and then asks that JID if it
wants to do this. When they register we ask them to confirm they want to
swap, and then send the backend the actual JID change operation.
Show possible route for confused users who came from web register
Don't accept gateway JID with node or resource

Most of the code assumes a gateway JID is a bare domain.
Enter Gateway vs Enter Gateway JID

To reduce the chance than anyone thinks their JID should go here.
Fix spelling on status=canceled and add a note
If backend cancels the flow, cancel the session and do not save
Shorthand for starting registration process

You can now say "register jmp.chat" to start the registration process.  This
allows us to have a stateless backend-initiated flow so the user can be promted
to run this command (vs being prompted to say "register" and then say "jmp.chat"
in answer to an unexpected qustion).
ConfigureDirectMessageRoute should keep the from if already from the compoent

This is for Adhoc bot -- the from is already from us, so avoid double-escaping
and confusing everyone.
Allow backend route to expose an ad-hoc command for registration

In case a backend requires a multi-stage registration, pass through their
command steps as part of our command flow and save if successful.  Continue to
use IBR with backends that do not list a command with node jabber:iq:gateway.
Merge branch 'fix-errors-in-adhoc'

* fix-errors-in-adhoc:
  IQManager should get both IQResult and IQError
  Never reply to an error
Never reply to an error

This can cause an error loop, especially if the other side does the same.
Fix clear-before-continue and allow pre-registered users to click a "finish" button
Clear old route before setting new one

Closes #47
When submit no route, delete existing route

Closes #48
Hack to pass through some kind of error at least
Save if already registered to gateway
Show currently-set route if there is one
Show pre-registered form when gateway gives us one
Pass errors through better during 1:1 setup
Proxy through the registration form and record the route