Issue in blocking user in chatlist using smack and open fire server

后端 未结 4 1948
小蘑菇
小蘑菇 2021-02-15 17:51

I want to block a particular friend from my chat list with XMPP. code works fine. There is no Exception, but I am not able to block a user. I\'m using open fire ser

4条回答
  •  故里飘歌
    2021-02-15 18:19

    I think that the problem should be one of the following:

    • userName isn't correct, for example "someuser@myxmppserver.com".
    • You are not listening for privacy changes I mean, you didn't implement the PrivacyListListener interface.
    • In the PrivacyItem constructor don't you should use PrivacyRule.JID instead PrivacyItem.Type.jid.toString()?.
    • If you wanna block a friend don't you should use updatePrivacyList instead createPrivacyList.

    I reccomend you take a closer look to the documentation Smack documentation

提交回复
热议问题