mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-29 17:52:06 +01:00
Change type of purge/remove IQ (XEP-0013) to 'set'
Fixes SMACK-726
This commit is contained in:
parent
45b04800a4
commit
66f4b9cdff
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue