ejabberd - Comments for "Authorizing requests of a specific type" https://www.ejabberd.im/node/4694 en If you apply this change to https://www.ejabberd.im/node/4694#comment-57346 <p>If you apply this change to ejabberd 2.1.x</p> <pre> diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 7888256..4276ee6 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -1784,12 +1784,17 @@ presence_track(From, To, Packet, StateData) -&gt; StateData#state{pres_i = I, pres_a = A}; "subscribe" -&gt; + case xml:get_attr_s("subscribe-token", Attrs) of + "abcd" -&gt; ejabberd_hooks:run(roster_out_subscription, Server, [User, Server, To, subscribe]), check_privacy_route(From, StateData, jlib:jid_remove_resource(From), To, Packet), StateData; + _ -&gt; + StateData + end; "subscribed" -&gt; ejabberd_hooks:run(roster_out_subscription, Server, </pre><p> When a client sends this, nothing happens:</p> <pre> &lt;presence type='subscribe' to='badlop2@localhost'&gt; &lt;status&gt;Me gustaría añadirte a mi lista de contactos.&lt;status&gt; &lt;presence&gt; </pre><p> When a client sends this, the subscription works as usual:</p> <pre> &lt;presence subscribe-token="abcd" type='subscribe' to='badlop2@localhost'&gt; &lt;status&gt;Me gustaría añadirte a mi lista de contactos.&lt;status&gt; &lt;presence&gt; </pre> Tue, 17 May 2011 11:26:43 +0000 mfoss comment 57346 at https://www.ejabberd.im