~singpolyma/cheogram

5b42941c65ff69c5c5b1d2e09650d19ee2ad66e8 — Stephen Paul Weber 2 years ago 6c12cee
Re-enable registration

It's not clear why it was ever removed.  I forget, and the commit and the
related issue both just say "disable for now".  So re-enable the code path.  No
one really uses it, but it's not dangerous and gives us a place to put other
registration code as well.
1 files changed, 3 insertions(+), 3 deletions(-)

M Main.hs
M Main.hs => Main.hs +3 -3
@@ 974,10 974,10 @@ componentStanza (ComponentContext { db, componentJid }) (ReceivedIQ iq@(IQ { iqT
					s"To start registration with " ++ XMPP.formatJID from ++ s" reply with: register " ++ XMPP.formatJID from ++
					s"\n(If you do not wish to start this registration, simply ignore this message.)"
			]
componentStanza _ (ReceivedIQ iq@(IQ { iqFrom = Just _, iqTo = Just (JID { jidNode = Nothing }), iqPayload = Just p }))
componentStanza (ComponentContext { db, componentJid }) (ReceivedIQ iq@(IQ { iqFrom = Just _, iqTo = Just (JID { jidNode = Nothing }), iqPayload = Just p }))
	| iqType iq `elem` [IQGet, IQSet],
	  [_] <- isNamed (fromString "{jabber:iq:register}query") p = do
		return [mkStanzaRec $ iqNotImplemented iq]
	  [query] <- isNamed (fromString "{jabber:iq:register}query") p = do
		handleRegister db componentJid iq query
componentStanza (ComponentContext { db, componentJid, maybeAvatar, sendIQ }) (ReceivedIQ (IQ { iqType = IQGet, iqFrom = Just from, iqTo = Just to, iqID = id, iqPayload = Just p }))
	| Nothing <- jidNode to,
	  [q] <- isNamed (fromString "{http://jabber.org/protocol/disco#info}query") p = do