mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Add support for XEP-360: Nonzas
SMACK-682
This commit is contained in:
parent
734695c80e
commit
710948c8f7
20 changed files with 126 additions and 86 deletions
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smack.sm.packet;
|
||||
|
||||
import org.jivesoftware.smack.packet.FullStreamElement;
|
||||
import org.jivesoftware.smack.packet.Nonza;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XMPPError;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
@ -50,7 +50,7 @@ public class StreamManagement {
|
|||
}
|
||||
}
|
||||
|
||||
private static abstract class AbstractEnable extends FullStreamElement {
|
||||
private static abstract class AbstractEnable implements Nonza {
|
||||
|
||||
/**
|
||||
* Preferred maximum resumption time in seconds (optional).
|
||||
|
@ -186,7 +186,7 @@ public class StreamManagement {
|
|||
}
|
||||
}
|
||||
|
||||
public static class Failed extends FullStreamElement {
|
||||
public static class Failed implements Nonza {
|
||||
public static final String ELEMENT = "failed";
|
||||
|
||||
private XMPPError.Condition condition;
|
||||
|
@ -229,7 +229,7 @@ public class StreamManagement {
|
|||
|
||||
}
|
||||
|
||||
private static abstract class AbstractResume extends FullStreamElement {
|
||||
private static abstract class AbstractResume implements Nonza {
|
||||
|
||||
private final long handledCount;
|
||||
private final String previd;
|
||||
|
@ -288,7 +288,7 @@ public class StreamManagement {
|
|||
}
|
||||
}
|
||||
|
||||
public static class AckAnswer extends FullStreamElement {
|
||||
public static class AckAnswer implements Nonza {
|
||||
public static final String ELEMENT = "a";
|
||||
|
||||
private final long handledCount;
|
||||
|
@ -320,7 +320,7 @@ public class StreamManagement {
|
|||
}
|
||||
}
|
||||
|
||||
public static final class AckRequest extends FullStreamElement {
|
||||
public static final class AckRequest implements Nonza {
|
||||
public static final String ELEMENT = "r";
|
||||
public static final AckRequest INSTANCE = new AckRequest();
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ import org.jivesoftware.smack.sm.packet.StreamManagement.Resumed;
|
|||
import org.jivesoftware.smack.sm.packet.StreamManagement.StreamManagementFeature;
|
||||
import org.jivesoftware.smack.sm.predicates.Predicate;
|
||||
import org.jivesoftware.smack.sm.provider.ParseStreamManagement;
|
||||
import org.jivesoftware.smack.packet.PlainStreamElement;
|
||||
import org.jivesoftware.smack.packet.Nonza;
|
||||
import org.jivesoftware.smack.packet.XMPPError;
|
||||
import org.jivesoftware.smack.util.ArrayBlockingQueueWithShutdown;
|
||||
import org.jivesoftware.smack.util.Async;
|
||||
|
@ -511,7 +511,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void send(PlainStreamElement element) throws NotConnectedException, InterruptedException {
|
||||
public void sendNonza(Nonza element) throws NotConnectedException, InterruptedException {
|
||||
packetWriter.sendStreamElement(element);
|
||||
}
|
||||
|
||||
|
@ -847,7 +847,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
|
||||
if (config.getSecurityMode() != ConnectionConfiguration.SecurityMode.disabled) {
|
||||
send(new StartTls());
|
||||
sendNonza(new StartTls());
|
||||
}
|
||||
}
|
||||
// If TLS is required but the server doesn't offer it, disconnect
|
||||
|
@ -886,7 +886,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
from = XmppStringUtils.completeJidFrom(localpart, to);
|
||||
}
|
||||
String id = getStreamId();
|
||||
send(new StreamOpen(to, from, id));
|
||||
sendNonza(new StreamOpen(to, from, id));
|
||||
try {
|
||||
packetReader.parser = PacketParserUtils.newXmppParser(reader);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue