0
我想从我的ejabberd服务器删除用户,但我连续接收以下错误:org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: not-allowed - cancel
删除用户(嫌)
我假设这事做与用户权限?所有人都可以注册,这样不应该成为问题吗?
这里是我的代码如下所示:
@Override
protected Boolean doInBackground(String... params) {
builder.setUsernameAndPassword(params[0], params[1]);
mConnection = new XMPPTCPConnection(builder.build());
try {
mConnection.connect();
} catch (SmackException | IOException | XMPPException e) {
Log.d(TAG, "Something went wrong when trying to connect");
e.printStackTrace();
return false;
}
AccountManager manager = AccountManager.getInstance(mConnection);
manager.sensitiveOperationOverInsecureConnection(true);
try {
manager.deleteAccount();
} catch (SmackException.NoResponseException | XMPPException.XMPPErrorException | SmackException.NotConnectedException e) {
Log.d(TAG, "Something went wrong when trying delete the account");
e.printStackTrace();
return false;
}
return true;
}