196 pres.attr.to = nil; |
196 pres.attr.to = nil; |
197 pres.attr.from = nil; |
197 pres.attr.from = nil; |
198 end |
198 end |
199 end |
199 end |
200 else |
200 else |
201 send(origin, st.presence({from=user.."@"..host, to=stanza.attr.from, type="unsubscribed"})); |
201 send(origin, st.presence({from=user.."@"..host, to=origin.username.."@"..origin.host, type="unsubscribed"})); |
202 end |
202 end |
203 elseif stanza.attr.type == "subscribe" then |
203 elseif stanza.attr.type == "subscribe" then |
204 -- TODO |
204 -- TODO |
205 elseif stanza.attr.type == "unsubscribe" then |
205 elseif stanza.attr.type == "unsubscribe" then |
206 -- TODO |
206 -- TODO |
250 end |
250 end |
251 else -- user does not exist |
251 else -- user does not exist |
252 -- TODO we would get here for nodeless JIDs too. Do something fun maybe? Echo service? Let plugins use xmpp:server/resource addresses? |
252 -- TODO we would get here for nodeless JIDs too. Do something fun maybe? Echo service? Let plugins use xmpp:server/resource addresses? |
253 if stanza.name == "presence" then |
253 if stanza.name == "presence" then |
254 if stanza.attr.type == "probe" then |
254 if stanza.attr.type == "probe" then |
255 send(origin, st.presence({from = node.."@"..host, to = origin.username.."@"..origin.host, type = "unsubscribed"})); |
255 send(origin, st.presence({from = stanza.attr.to, to = stanza.attr.from, type = "unsubscribed"})); |
256 end |
256 end |
257 -- else ignore |
257 -- else ignore |
258 else |
258 else |
259 send(origin, st.error_reply(stanza, "cancel", "service-unavailable")); |
259 send(origin, st.error_reply(stanza, "cancel", "service-unavailable")); |
260 end |
260 end |