diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-03-31 14:54:45 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-03-31 14:54:45 +0200 |
commit | 9fa77720e18b493e2199ed0d0f74a15126bf719e (patch) | |
tree | 6999e73875afba13eeb28cd829831c26ab7365a8 /src/main/java/de/pixart/messenger/xmpp | |
parent | da205a2ebf79641ce3c14dba3c2ecf3c671a403b (diff) |
add ability to delete account also from server
fixes #315
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index dd82ab7bb..8910ee418 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1017,6 +1017,22 @@ public class XmppConnection implements Runnable { }, true); } + public void sendDeleteRequest() { + final IqPacket delete = new IqPacket(IqPacket.TYPE.SET); + delete.query("jabber:iq:register").addChild("remove"); + delete.setTo(Jid.of(account.getServer())); + delete.setFrom(account.getJid().asBareJid()); + Log.d(Config.LOGTAG, "Delete " + delete); + sendUnmodifiedIqPacket(delete, (account, packet) -> { + if (packet.getType() == IqPacket.TYPE.TIMEOUT) { + return; + } + if (packet.getType() == IqPacket.TYPE.ERROR) { + throw new StateChangingError(Account.State.DISABLED); + } + }, true); + } + private void setAccountCreationFailed(String url) { if (url != null) { |