singpolyma / cheogram

Moved to https://git.singpolyma.net/cheogram
https://cheogram.com
GNU Affero General Public License v3.0
27 stars 5 forks source link

Allow users to associate a number for 1:1 #39

Closed singpolyma closed 7 years ago

singpolyma commented 8 years ago

Allow users to associate a number they own (or we own on their behalf, or whatever) to their non-Cheogram JID. All whispers from them would be routed from this number instead of using a cheogram whisper. This enables seamless 1:1 XMPP:SMS bridging at the extra cost of one telephone number per user that has it enabled.

singpolyma commented 7 years ago

The plan, outlined at https://github.com/ossguy/etps/issues/1 is to use an ad-hoc command to allow users to specify any SMS transport to have Cheogram use for their whispers instead of the default transport. We pass through the registration form and store nothing but the transport's JID.

What JID should we send the registration and messages from? We cannot use the root Cheogram JID since more than one user might use the same remote transport and gateway registration sort of assumes one registration per JID (so that it knows where to route messages).

So, the idea is to use <escaped user JID>@<cheogram root JID> as the source. Messages to such a JID are ignored (or error response) unless they are from the known-to-be-associated transport. Messages from the transport are relayed to the JID in the localpart, but changing the domain part in the from to the Cheogram hostname (and stripping any resource).