<?xml version="1.0" encoding="UTF-8"?>

<raptor xmlns:action="http://martin-weusten.de/raptor/action" xmlns:check="http://martin-weusten.de/raptor/check">
	<name>Transports</name>
	<desc>Protect your transports and user directory from external users using JID-variables. Useful when using pyICQt or pyMSNt, respectively.</desc>
	<version>2</version>
	<var type="JID" name="COMPONENT"/>
	<var type="JID" name="USER"/>
	<function name="PROTECT_TRANSPORTS">
		<action:rule>
			<if>
				<check:jid name="COMPONENT" mode="NDOMAIN" ref="icq.localhost"/>
				<check:jid name="COMPONENT" mode="NDOMAIN" ref="msn.localhost"/>
				<check:jid name="COMPONENT" mode="NDOMAIN" ref="search.localhost"/>
			</if>
			<else>
				<action:rule>
					<if>
						<check:jid name="USER" mode="NDOMAIN" ref="localhost"/>
						<check:jid name="USER" mode="NGROUP" ref="whitelist"/>
						<check:jid name="USER" mode="NDOMAIN" ref="component.localhost"/>
						<check:jid name="USER" mode="NDOMAIN" ref="raptor.localhost"/>
					</if>
					<then>
						<action:drop/>
					</then>
				</action:rule>
			</else>
		</action:rule>
	</function>
	<function name="MAIN">
		<action:set_jid name="USER" mode="FROM"/>
		<action:set_jid name="COMPONENT" mode="TO"/>
		<action:call function="PROTECT_TRANSPORTS"/>
		<action:set_jid name="USER" mode="TO"/>
		<action:set_jid name="COMPONENT" mode="FROM"/>
		<action:call function="PROTECT_TRANSPORTS"/>
	</function>
</raptor>

