How do I delete a user ?
Can I delete a user without login ?
How do I delete a user ?
Can I delete a user without login ?
Hey Tan Chen,
You may want to delete the user from the server side. If you are using Wildfire you can do it from the admin console. Wildfire supports ad-hoc commands (similar to RPC) so in a future version you should also be able to delete users from your client (if you are an administrator).
To delete your[/b] user from Smack you should be logged in. Use the following code to delete your account.
connection.getAccountManager().deleteAccount()[/code]
Regards,
– Gato
I would like to delete the user by code - smack api, not on the server side.
Here is my code:
public void deleteUser()
{
XMPPConnection l_xmmpConnection = null;
try
{
PrintLog(“Delete user.”);
l_xmmpConnection = new XMPPConnection(“jabber.org”, 5222);
l_xmmpConnection.login(“tancy”, “tancy”);
AccountManager l_accountManager = l_xmmpConnection.getAccountManager();
l_accountManager.deleteAccount();
PrintLog(“User is deleted.”);
}
catch (Exception ex)
{
PrintLog("Exception in deleteUser: " + ex.toString());
}
l_xmmpConnection.close();
}
After I ran, I got:
E:\Jabber\API\Smack 2.1.0\code>java -classpath …/smack.jar;…/smackx.jar;./ Test
Delete user.
Exception in deleteUser: No response from server.:
How come I have an exception ? But the tancy user indeed was deleted. How come ?
Hi
i get also this error when i delete a user, seems to be in the xml parser… ? Here’‘s my output. Thank’'s for help!
java.io.EOFException: no more data available - expected end tag … @1:991
at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3014)
at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:352)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:63)
No response from server.:
at org.jivesoftware.smack.AccountManager.deleteAccount(AccountManager.java:266)
…
Message was edited by: stephanw