mod_smacks: Bounce unhandled stanzas from local origin (fix #1759)
Sending stanzas with a remote session as origin when the stanzas have a
local JID in the from attribute trips validation in core.stanza_router,
leading to warnings:
> Received a stanza claiming to be from remote.example, over a stream authed for localhost.example
Using module:send() uses the local host as origin, which is fine here.
No 'to' attribute:
IQ: Pass to appropriate handler
Presence: Broadcast to contacts
- if initial presence, also send out presence probes
- if probe would be to local user, generate presence stanza for them
Message: Route as if it is addressed to the bare JID of the sender
To a local host:
IQ: Pass to appropriate handler
Presence: -
Message: Deliver to admin?
To local contact:
Bare JID:
IQ: Pass to appropriate handler
Presence: Broadcast to all resources
Message: Route to 'best' resource
Full JID:
IQ: Send to resource
Presence: Send to resource
Message: Send to resource
Full JID but resource not connected:
IQ: Return service-unavailable
Message: Handle same as if to bare JID
Presence: Drop (unless type=subscribe[ed])
To remote contact:
Initiate s2s connection if necessary
Send stanza across