313 elseif stanza.name == "presence" then -- hack - some buggy clients send presence updates to the room rather than their nick |
313 elseif stanza.name == "presence" then -- hack - some buggy clients send presence updates to the room rather than their nick |
314 local to = stanza.attr.to; |
314 local to = stanza.attr.to; |
315 local current_nick = self._jid_nick[stanza.attr.from]; |
315 local current_nick = self._jid_nick[stanza.attr.from]; |
316 if current_nick then |
316 if current_nick then |
317 stanza.attr.to = current_nick; |
317 stanza.attr.to = current_nick; |
318 room_handle_to_occupant(origin, stanza); |
318 room_handle_to_occupant(self, origin, stanza); |
319 stanza.attr.to = to; |
319 stanza.attr.to = to; |
320 elseif type ~= "error" and type ~= "result" then |
320 elseif type ~= "error" and type ~= "result" then |
321 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
321 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
322 end |
322 end |
323 elseif stanza.name == "message" and not stanza.attr.type and #stanza.tags == 1 and self._jid_nick[stanza.attr.from] |
323 elseif stanza.name == "message" and not stanza.attr.type and #stanza.tags == 1 and self._jid_nick[stanza.attr.from] |