mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-12 08:01:08 +01:00
s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/
This commit is contained in:
parent
9328182912
commit
90a5e289f8
100 changed files with 406 additions and 406 deletions
|
|
@ -22,7 +22,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import org.jivesoftware.smack.MessageListener;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.StanzaCollector;
|
||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.StanzaListener;
|
||||
|
|
@ -86,7 +86,7 @@ public class MultiUserChatLight {
|
|||
|
||||
private final StanzaListener messageListener;
|
||||
|
||||
private PacketCollector messageCollector;
|
||||
private StanzaCollector messageCollector;
|
||||
|
||||
MultiUserChatLight(XMPPConnection connection, EntityJid room) {
|
||||
this.connection = connection;
|
||||
|
|
@ -97,7 +97,7 @@ public class MultiUserChatLight {
|
|||
|
||||
messageListener = new StanzaListener() {
|
||||
@Override
|
||||
public void processPacket(Stanza packet) throws NotConnectedException {
|
||||
public void processStanza(Stanza packet) throws NotConnectedException {
|
||||
Message message = (Message) packet;
|
||||
for (MessageListener listener : messageListeners) {
|
||||
listener.processMessage(message);
|
||||
|
|
@ -263,10 +263,10 @@ public class MultiUserChatLight {
|
|||
throws Exception {
|
||||
MUCLightCreateIQ createMUCLightIQ = new MUCLightCreateIQ(room, roomName, occupants);
|
||||
|
||||
messageCollector = connection.createPacketCollector(fromRoomGroupchatFilter);
|
||||
messageCollector = connection.createStanzaCollector(fromRoomGroupchatFilter);
|
||||
|
||||
try {
|
||||
connection.createPacketCollectorAndSend(createMUCLightIQ).nextResultOrThrow();
|
||||
connection.createStanzaCollectorAndSend(createMUCLightIQ).nextResultOrThrow();
|
||||
} catch (InterruptedException | NoResponseException | XMPPErrorException e) {
|
||||
removeConnectionCallbacks();
|
||||
throw e;
|
||||
|
|
@ -297,7 +297,7 @@ public class MultiUserChatLight {
|
|||
affiliations.put(connection.getUser(), MUCLightAffiliation.none);
|
||||
|
||||
MUCLightChangeAffiliationsIQ changeAffiliationsIQ = new MUCLightChangeAffiliationsIQ(room, affiliations);
|
||||
IQ responseIq = connection.createPacketCollectorAndSend(changeAffiliationsIQ).nextResultOrThrow();
|
||||
IQ responseIq = connection.createStanzaCollectorAndSend(changeAffiliationsIQ).nextResultOrThrow();
|
||||
boolean roomLeft = responseIq.getType().equals(IQ.Type.result);
|
||||
|
||||
if (roomLeft) {
|
||||
|
|
@ -319,7 +319,7 @@ public class MultiUserChatLight {
|
|||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MUCLightGetInfoIQ mucLightGetInfoIQ = new MUCLightGetInfoIQ(room, version);
|
||||
|
||||
IQ responseIq = connection.createPacketCollectorAndSend(mucLightGetInfoIQ).nextResultOrThrow();
|
||||
IQ responseIq = connection.createStanzaCollectorAndSend(mucLightGetInfoIQ).nextResultOrThrow();
|
||||
MUCLightInfoIQ mucLightInfoResponseIQ = (MUCLightInfoIQ) responseIq;
|
||||
|
||||
return new MUCLightRoomInfo(mucLightInfoResponseIQ.getVersion(), room,
|
||||
|
|
@ -353,7 +353,7 @@ public class MultiUserChatLight {
|
|||
public MUCLightRoomConfiguration getConfiguration(String version)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MUCLightGetConfigsIQ mucLightGetConfigsIQ = new MUCLightGetConfigsIQ(room, version);
|
||||
IQ responseIq = connection.createPacketCollectorAndSend(mucLightGetConfigsIQ).nextResultOrThrow();
|
||||
IQ responseIq = connection.createStanzaCollectorAndSend(mucLightGetConfigsIQ).nextResultOrThrow();
|
||||
MUCLightConfigurationIQ mucLightConfigurationIQ = (MUCLightConfigurationIQ) responseIq;
|
||||
return mucLightConfigurationIQ.getConfiguration();
|
||||
}
|
||||
|
|
@ -386,7 +386,7 @@ public class MultiUserChatLight {
|
|||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MUCLightGetAffiliationsIQ mucLightGetAffiliationsIQ = new MUCLightGetAffiliationsIQ(room, version);
|
||||
|
||||
IQ responseIq = connection.createPacketCollectorAndSend(mucLightGetAffiliationsIQ).nextResultOrThrow();
|
||||
IQ responseIq = connection.createStanzaCollectorAndSend(mucLightGetAffiliationsIQ).nextResultOrThrow();
|
||||
MUCLightAffiliationsIQ mucLightAffiliationsIQ = (MUCLightAffiliationsIQ) responseIq;
|
||||
|
||||
return mucLightAffiliationsIQ.getAffiliations();
|
||||
|
|
@ -418,7 +418,7 @@ public class MultiUserChatLight {
|
|||
public void changeAffiliations(HashMap<Jid, MUCLightAffiliation> affiliations)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MUCLightChangeAffiliationsIQ changeAffiliationsIQ = new MUCLightChangeAffiliationsIQ(room, affiliations);
|
||||
connection.createPacketCollectorAndSend(changeAffiliationsIQ).nextResultOrThrow();
|
||||
connection.createStanzaCollectorAndSend(changeAffiliationsIQ).nextResultOrThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -431,7 +431,7 @@ public class MultiUserChatLight {
|
|||
*/
|
||||
public void destroy() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MUCLightDestroyIQ mucLightDestroyIQ = new MUCLightDestroyIQ(room);
|
||||
IQ responseIq = connection.createPacketCollectorAndSend(mucLightDestroyIQ).nextResultOrThrow();
|
||||
IQ responseIq = connection.createStanzaCollectorAndSend(mucLightDestroyIQ).nextResultOrThrow();
|
||||
boolean roomDestroyed = responseIq.getType().equals(IQ.Type.result);
|
||||
|
||||
if (roomDestroyed) {
|
||||
|
|
@ -451,7 +451,7 @@ public class MultiUserChatLight {
|
|||
public void changeSubject(String subject)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ(room, null, subject, null);
|
||||
connection.createPacketCollectorAndSend(mucLightSetConfigIQ).nextResultOrThrow();
|
||||
connection.createStanzaCollectorAndSend(mucLightSetConfigIQ).nextResultOrThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -466,7 +466,7 @@ public class MultiUserChatLight {
|
|||
public void changeRoomName(String roomName)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ(room, roomName, null);
|
||||
connection.createPacketCollectorAndSend(mucLightSetConfigIQ).nextResultOrThrow();
|
||||
connection.createStanzaCollectorAndSend(mucLightSetConfigIQ).nextResultOrThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -496,7 +496,7 @@ public class MultiUserChatLight {
|
|||
public void setRoomConfigs(String roomName, HashMap<String, String> customConfigs)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ(room, roomName, customConfigs);
|
||||
connection.createPacketCollectorAndSend(mucLightSetConfigIQ).nextResultOrThrow();
|
||||
connection.createStanzaCollectorAndSend(mucLightSetConfigIQ).nextResultOrThrow();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
|
||||
StanzaFilter responseFilter = new IQReplyFilter(mucLightBlockingIQ, connection());
|
||||
IQ responseIq = connection().createPacketCollectorAndSend(responseFilter, mucLightBlockingIQ)
|
||||
IQ responseIq = connection().createStanzaCollectorAndSend(responseFilter, mucLightBlockingIQ)
|
||||
.nextResultOrThrow();
|
||||
MUCLightBlockingIQ muclIghtBlockingIQResult = (MUCLightBlockingIQ) responseIq;
|
||||
|
||||
|
|
@ -278,7 +278,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(rooms, null);
|
||||
mucLightBlockingIQ.setType(Type.set);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
connection().createPacketCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
connection().createStanzaCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -322,7 +322,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(null, users);
|
||||
mucLightBlockingIQ.setType(Type.set);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
connection().createPacketCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
connection().createStanzaCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -366,7 +366,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(rooms, null);
|
||||
mucLightBlockingIQ.setType(Type.set);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
connection().createPacketCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
connection().createStanzaCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -410,7 +410,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(null, users);
|
||||
mucLightBlockingIQ.setType(Type.set);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
connection().createPacketCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
connection().createStanzaCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue