1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 18:29:45 +02:00

s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/

This commit is contained in:
Florian Schmaus 2017-01-03 11:12:34 +01:00
parent 9328182912
commit 90a5e289f8
100 changed files with 406 additions and 406 deletions

View file

@ -17,7 +17,7 @@
package org.jivesoftware.smack.chat;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.StanzaCollector;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.util.StringUtils;
@ -155,14 +155,14 @@ public class Chat {
}
/**
* Creates a {@link org.jivesoftware.smack.PacketCollector} which will accumulate the Messages
* for this chat. Always cancel PacketCollectors when finished with them as they will accumulate
* Creates a {@link org.jivesoftware.smack.StanzaCollector} which will accumulate the Messages
* for this chat. Always cancel StanzaCollectors when finished with them as they will accumulate
* messages indefinitely.
*
* @return the PacketCollector which returns Messages for this chat.
* @return the StanzaCollector which returns Messages for this chat.
*/
public PacketCollector createCollector() {
return chatManager.createPacketCollector(this);
public StanzaCollector createCollector() {
return chatManager.createStanzaCollector(this);
}
/**

View file

@ -28,7 +28,7 @@ import java.util.logging.Logger;
import org.jivesoftware.smack.Manager;
import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.StanzaCollector;
import org.jivesoftware.smack.StanzaListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.SmackException.NotConnectedException;
@ -149,7 +149,7 @@ public final class ChatManager extends Manager{
// Add a listener for all message packets so that we can deliver
// messages to the best Chat instance available.
connection.addSyncStanzaListener(new StanzaListener() {
public void processPacket(Stanza packet) {
public void processStanza(Stanza packet) {
Message message = (Message) packet;
Chat chat;
if (message.getThread() == null) {
@ -378,8 +378,8 @@ public final class ChatManager extends Manager{
connection().sendStanza(message);
}
PacketCollector createPacketCollector(Chat chat) {
return connection().createPacketCollector(new AndFilter(new ThreadFilter(chat.getThreadID()),
StanzaCollector createStanzaCollector(Chat chat) {
return connection().createStanzaCollector(new AndFilter(new ThreadFilter(chat.getThreadID()),
FromMatchesFilter.create(chat.getParticipant())));
}

View file

@ -244,7 +244,7 @@ public final class Roster extends Manager {
connection.addAsyncStanzaListener(new StanzaListener() {
@Override
public void processPacket(Stanza stanza) throws NotConnectedException,
public void processStanza(Stanza stanza) throws NotConnectedException,
InterruptedException {
Presence presence = (Presence) stanza;
Jid from = presence.getFrom();
@ -318,7 +318,7 @@ public final class Roster extends Manager {
connection.addPacketSendingListener(new StanzaListener() {
@Override
public void processPacket(Stanza stanzav) throws NotConnectedException, InterruptedException {
public void processStanza(Stanza stanzav) throws NotConnectedException, InterruptedException {
// Once we send an unavailable presence, the server is allowed to suppress sending presence status
// information to us as optimization (RFC 6121 § 4.4.2). Thus XMPP clients which are unavailable, should
// consider the presence information of their contacts as not up-to-date. We make the user obvious of
@ -614,7 +614,7 @@ public final class Roster extends Manager {
}
}
rosterPacket.addRosterItem(item);
connection.createPacketCollectorAndSend(rosterPacket).nextResultOrThrow();
connection.createStanzaCollectorAndSend(rosterPacket).nextResultOrThrow();
sendSubscriptionRequest(user);
}
@ -744,7 +744,7 @@ public final class Roster extends Manager {
// Set the item type as REMOVE so that the server will delete the entry
item.setItemType(RosterPacket.ItemType.remove);
packet.addRosterItem(item);
connection.createPacketCollectorAndSend(packet).nextResultOrThrow();
connection.createStanzaCollectorAndSend(packet).nextResultOrThrow();
}
/**
@ -1189,11 +1189,11 @@ public final class Roster extends Manager {
}
packetUnavailable.setFrom(JidCreate.fullFrom(bareUserJid, resource));
try {
presencePacketListener.processPacket(packetUnavailable);
presencePacketListener.processStanza(packetUnavailable);
}
catch (NotConnectedException e) {
throw new IllegalStateException(
"presencePakcetListener should never throw a NotConnectedException when processPacket is called with a presence of type unavailable",
"presencePakcetListener should never throw a NotConnectedException when processStanza is called with a presence of type unavailable",
e);
}
catch (InterruptedException e) {
@ -1422,7 +1422,7 @@ public final class Roster extends Manager {
private class PresencePacketListener implements StanzaListener {
@Override
public void processPacket(Stanza packet) throws NotConnectedException, InterruptedException {
public void processStanza(Stanza packet) throws NotConnectedException, InterruptedException {
// Try to ensure that the roster is loaded when processing presence stanzas. While the
// presence listener is synchronous, the roster result listener is not, which means that
// the presence listener may be invoked with a not yet loaded roster.
@ -1562,7 +1562,7 @@ public final class Roster extends Manager {
private class RosterResultListener implements StanzaListener {
@Override
public void processPacket(Stanza packet) {
public void processStanza(Stanza packet) {
final XMPPConnection connection = connection();
LOGGER.fine("RosterResultListener received stanza");
Collection<Jid> addedEntries = new ArrayList<>();

View file

@ -109,7 +109,7 @@ public final class RosterEntry extends Manager {
// Create a new roster item with the current RosterEntry and the *new* name. Note that we can't set the name of
// RosterEntry right away, as otherwise the updated event wont get fired, because equalsDeep would return true.
packet.addRosterItem(toRosterItem(this, name));
connection().createPacketCollectorAndSend(packet).nextResultOrThrow();
connection().createStanzaCollectorAndSend(packet).nextResultOrThrow();
// We have received a result response to the IQ set, the name was successfully changed
item.setName(name);

View file

@ -84,7 +84,7 @@ public class RosterGroup extends Manager {
item.removeGroupName(this.name);
item.addGroupName(name);
packet.addRosterItem(item);
connection().createPacketCollectorAndSend(packet).nextResultOrThrow();
connection().createStanzaCollectorAndSend(packet).nextResultOrThrow();
}
}
}
@ -179,7 +179,7 @@ public class RosterGroup extends Manager {
item.addGroupName(getName());
packet.addRosterItem(item);
// Wait up to a certain number of seconds for a reply from the server.
connection().createPacketCollectorAndSend(packet).nextResultOrThrow();
connection().createStanzaCollectorAndSend(packet).nextResultOrThrow();
}
}
}
@ -210,7 +210,7 @@ public class RosterGroup extends Manager {
item.removeGroupName(this.getName());
packet.addRosterItem(item);
// Wait up to a certain number of seconds for a reply from the server.
connection().createPacketCollectorAndSend(packet).nextResultOrThrow();
connection().createStanzaCollectorAndSend(packet).nextResultOrThrow();
}
}
}