~singpolyma/cheogram

ff614264a32e228dc360ad903d959f81937b3aac — Stephen Paul Weber a month ago 5ca8323
Don't accept gateway JID with node or resource

Most of the code assumes a gateway JID is a bare domain.
1 files changed, 2 insertions(+), 1 deletions(-)

M ConfigureDirectMessageRoute.hs
M ConfigureDirectMessageRoute.hs => ConfigureDirectMessageRoute.hs +2 -1
@@ 200,7 200,8 @@ stage3 stage2iqID stage2from _ sid iqID from query
stage2 :: Session
stage2 componentDomain sid iqID from command
	| [form] <- isNamed (fromString "{jabber:x:data}x") =<< elementChildren command,
	  Just gatewayJid <- XMPP.parseJID =<< getFormField form (s"gateway-jid") =
	  Just gatewayJid <- XMPP.parseJID =<< getFormField form (s"gateway-jid"),
	  XMPP.jidNode gatewayJid == Nothing && XMPP.jidResource gatewayJid == Nothing =
		(
			SessionNext $ commandOrIBR gatewayJid,
			(queryCommandList' gatewayJid sendFrom) {