projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
897312f
)
mod_muc/muc.lib: Use stanza:get_child() to locate MUC child element
author
Matthew Wild
<mwild1@gmail.com>
Sun, 3 Jan 2010 17:53:54 +0000
(17:53 +0000)
committer
Matthew Wild
<mwild1@gmail.com>
Sun, 3 Jan 2010 17:53:54 +0000
(17:53 +0000)
plugins/muc/muc.lib.lua
patch
|
blob
|
history
diff --git
a/plugins/muc/muc.lib.lua
b/plugins/muc/muc.lib.lua
index d28efa630231ac94b6a38ca4816ab7b43b6afffa..abbcb9a490c1e07fcfdd67aff58317041c25539f 100644
(file)
--- a/
plugins/muc/muc.lib.lua
+++ b/
plugins/muc/muc.lib.lua
@@
-777,15
+777,6
@@
function room_mt:set_role(actor, nick, role, callback, reason)
return true;
end
return true;
end
-local function _get_muc_child(stanza)
- for i=#stanza.tags,1,-1 do
- local tag = stanza.tags[i];
- if tag.name == "x" and tag.attr.xmlns == "http://jabber.org/protocol/muc#user" then
- return tag;
- end
- end
-end
-
function room_mt:_route_stanza(stanza)
local muc_child;
local to_occupant = self._occupants[self._jid_nick[stanza.attr.to]];
function room_mt:_route_stanza(stanza)
local muc_child;
local to_occupant = self._occupants[self._jid_nick[stanza.attr.to]];
@@
-793,10
+784,10
@@
function room_mt:_route_stanza(stanza)
if stanza.name == "presence" then
if to_occupant and from_occupant then
if self._data.whois == 'anyone' then
if stanza.name == "presence" then
if to_occupant and from_occupant then
if self._data.whois == 'anyone' then
- muc_child =
_get_muc_child(stanza)
+ muc_child =
stanza:get_child("x", "http://jabber.org/protocol/muc#user");
else
if to_occupant.role == "moderator" or jid_bare(to_occupant.jid) == jid_bare(from_occupant.jid) then
else
if to_occupant.role == "moderator" or jid_bare(to_occupant.jid) == jid_bare(from_occupant.jid) then
- muc_child =
_get_muc_child(stanza)
+ muc_child =
stanza:get_child("x", "http://jabber.org/protocol/muc#user");
end
end
end
end
end
end