processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.07k stars 1.51k forks source link

the privacy list which descibed by xep_0016 seems not work. #450

Closed hackrole closed 8 years ago

hackrole commented 9 years ago

I try to block other user's message but it seems not work. first I send xmpp privcy stanze like this.

DEBUG:sleekxmpp.xmlstream.xmlstream:SEND: <iq to="admin@localhost/bot" from="admin@localhost" id="342e07e1-891e-4696-93b5-3d14865ff6b4-F" type="result"><query xmlns="jabber:iq:privacy"><list name="black"><item action="deny" type="jid" order="1" value="183@localhost"><message /><iq /></item><item action="deny" type="jid" order="1" value="18344@localhost"><iq /><message /></item><item action="deny" type="jid" order="2" value="18344@localhost"><iq /><message /></item></list></query></iq>
DEBUG:sleekxmpp.xmlstream.xmlstream:RECV: <iq to="admin@localhost/bot" type="result" from="admin@localhost/bot" xml:lang="en" id="342e07e1-891e-4696-93b5-3d14865ff6b4-F"><query xmlns="jabber:iq:privacy"><list name="black"><item action="deny" type="jid" order="1" value="183@localhost"><message /><iq /></item><item action="deny" type="jid" order="1" value="18344@localhost"><iq /><message /></item><item action="deny" type="jid" order="2" value="18344@localhost"><iq /><message /></item></list></query></iq>

and then use the 183@localhost to send a message to the admin@localhost, the client not got any error.

hackrole commented 9 years ago

sorry for that, it seems I send error iq .

hackrole commented 9 years ago

seems it really not work. I send xmpp privacy ok and get the result ok

DEBUG:sleekxmpp.xmlstream.xmlstream:SEND:
<iq type="set" from="admin@localhost" id="0">
  <query xmlns="jabber:iq:privacy">
    <list name="black">
      <item action="deny" type="jid" order="1" value="183@localhost">
        <iq />
        <message />
      </item>
      <item action="deny" type="jid" order="1" value="18344@localhost">
        <iq />
        <message />
      </item>
      <item action="deny" type="jid" order="1" value="18224@localhost">
        <iq />
        <message />
      </item>
    </list>
  </query>
</iq>

DEBUG:sleekxmpp.xmlstream.xmlstream:RECV: 
<iq to="admin@localhost/bot" from="admin@localhost" id="push2453788533" type="set">
  <query xmlns="jabber:iq:privacy">
    <list name="black" />
  </query>
</iq>

DEBUG:sleekxmpp.xmlstream.xmlstream:SEND: 
<iq type="get" id="342e07e1-891e-4696-93b5-3d14865ff6b4-16">
  <query xmlns="jabber:iq:privacy">
    <list name="black" />
  </query>
</iq>

DEBUG:sleekxmpp.xmlstream.xmlstream:RECV: 
<iq to="admin@localhost/bot" from="admin@localhost" id="342e07e1-891e-4696-93b5-3d14865ff6b4-16" type="result">
  <query xmlns="jabber:iq:privacy">
    <list name="black">
      <item action="deny" type="jid" order="1" value="18224@localhost">
        <message />
        <iq />
      </item>
      <item action="deny" type="jid" order="1" value="18344@localhost">
        <message />
        <iq />
      </item>
      <item action="deny" type="jid" order="1" value="183@localhost">
        <message />
        <iq />
      </item>
    </list>
  </query>
</iq>

but when send message from 183@localhost, the client does got any errors.

badlop commented 8 years ago

You must also set that list as active, by sending something like this:

<iq from='admin@localhost/bot' type='set' id='active1'>
  <query xmlns='jabber:iq:privacy'>
    <active name='black'/>
  </query>
</iq>

See http://xmpp.org/extensions/xep-0016.html#protocol-active

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.