Open GoogleCodeExporter opened 8 years ago
Because i really needed it i wrote a stand-alone-fix, using the original
smack-code.
public void deleteFix() throws XMPPException {
if (!con.isAuthenticated()) {
throw new IllegalStateException("Must be logged in to delete a account.");
}
Registration reg = new Registration();
reg.setType(IQ.Type.SET);
reg.setTo(con.getServiceName());
//Map<String, String> attributes = new HashMap<String, String>();
// To delete an account, we add a single attribute, "remove", that is blank.
reg.addAttribute("remove", "");
PacketFilter filter = new AndFilter(new PacketIDFilter(reg.getPacketID()),
new PacketTypeFilter(IQ.class));
PacketCollector collector = con.createPacketCollector(filter);
con.sendPacket(reg);
IQ result = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
// Stop queuing results
collector.cancel();
if (result == null) {
throw new XMPPException("No response from server.");
}
else if (result.getType() == IQ.Type.ERROR) {
throw new XMPPException(result.getError());
}
}
To fix this it should be enough to change
public void setRemove(boolean remove){
this.remove = remove;
}
to
public void setRemove(boolean remove){
attributes.put("remove", "");
}
in packet/Registration.java
Original comment by vog...@gmail.com
on 10 Aug 2011 at 1:02
Original issue reported on code.google.com by
vog...@gmail.com
on 10 Aug 2011 at 12:39