1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-10-31 17:25:58 +01:00

Change type of purge/remove IQ (XEP-0013) to 'set'

Fixes SMACK-726
This commit is contained in:
Florian Schmaus 2016-07-06 08:38:26 +02:00
parent 45b04800a4
commit 66f4b9cdff

View file

@ -26,6 +26,7 @@ import org.jivesoftware.smack.filter.AndFilter;
import org.jivesoftware.smack.filter.StanzaExtensionFilter; import org.jivesoftware.smack.filter.StanzaExtensionFilter;
import org.jivesoftware.smack.filter.StanzaFilter; import org.jivesoftware.smack.filter.StanzaFilter;
import org.jivesoftware.smack.filter.StanzaTypeFilter; import org.jivesoftware.smack.filter.StanzaTypeFilter;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
@ -222,6 +223,7 @@ public class OfflineMessageManager {
*/ */
public void deleteMessages(List<String> nodes) throws NoResponseException, XMPPErrorException, NotConnectedException { public void deleteMessages(List<String> nodes) throws NoResponseException, XMPPErrorException, NotConnectedException {
OfflineMessageRequest request = new OfflineMessageRequest(); OfflineMessageRequest request = new OfflineMessageRequest();
request.setType(IQ.Type.set);
for (String node : nodes) { for (String node : nodes) {
OfflineMessageRequest.Item item = new OfflineMessageRequest.Item(node); OfflineMessageRequest.Item item = new OfflineMessageRequest.Item(node);
item.setAction("remove"); item.setAction("remove");
@ -240,6 +242,7 @@ public class OfflineMessageManager {
*/ */
public void deleteMessages() throws NoResponseException, XMPPErrorException, NotConnectedException { public void deleteMessages() throws NoResponseException, XMPPErrorException, NotConnectedException {
OfflineMessageRequest request = new OfflineMessageRequest(); OfflineMessageRequest request = new OfflineMessageRequest();
request.setType(IQ.Type.set);
request.setPurge(true); request.setPurge(true);
connection.createPacketCollectorAndSend(request).nextResultOrThrow(); connection.createPacketCollectorAndSend(request).nextResultOrThrow();
} }