X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_presence.lua;h=9e8f37dbe94a8dfe3aab528372c025203a2545dd;hb=163d2b9489196e5c9a532ecd4494afaddc414df6;hp=2899bd7e97e8b7bbbe18d98bcb786b9f944d9709;hpb=2812d8d444f3408276eba8108b2535a5446e82b3;p=prosody.git diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua index 2899bd7e..9e8f37db 100644 --- a/plugins/mod_presence.lua +++ b/plugins/mod_presence.lua @@ -55,14 +55,14 @@ local ignore_presence_priority = module:get_option("ignore_presence_priority"); function handle_normal_presence(origin, stanza) if ignore_presence_priority then - local priority = stanza:child_with_name("priority"); + local priority = stanza:get_child("priority"); if priority and priority[1] ~= "0" then for i=#priority.tags,1,-1 do priority.tags[i] = nil; end for i=#priority,1,-1 do priority[i] = nil; end priority[1] = "0"; end end - local priority = stanza:child_with_name("priority"); + local priority = stanza:get_child("priority"); if priority and #priority > 0 then priority = t_concat(priority); if s_find(priority, "^[+-]?[0-9]+$") then @@ -90,6 +90,7 @@ function handle_normal_presence(origin, stanza) end end if stanza.attr.type == nil and not origin.presence then -- initial presence + module:fire_event("presence/initial", { origin = origin, stanza = stanza } ); origin.presence = stanza; -- FIXME repeated later local probe = st.presence({from = origin.full_jid, type = "probe"}); for jid, item in pairs(roster) do -- probe all contacts we are subscribed to