diff options
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/XmppConnection.java')
-rw-r--r-- | src/eu/siacs/conversations/xmpp/XmppConnection.java | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index b2829c6e..72018394 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -18,7 +18,6 @@ import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; -import java.util.Iterator; import java.util.List; import java.util.Map.Entry; @@ -793,20 +792,10 @@ public class XmppConnection implements Runnable { this.sendPacket(packet, null); } - public void sendMessagePacket(MessagePacket packet, - OnMessagePacketReceived callback) { - this.sendPacket(packet, callback); - } - public void sendPresencePacket(PresencePacket packet) { this.sendPacket(packet, null); } - - public void sendPresencePacket(PresencePacket packet, - OnPresencePacketReceived callback) { - this.sendPacket(packet, callback); - } - + private synchronized void sendPacket(final AbstractStanza packet, PacketReceived callback) { // TODO dont increment stanza count if packet = request packet or ack; @@ -926,14 +915,10 @@ public class XmppConnection implements Runnable { public List<String> findDiscoItemsByFeature(String feature) { List<String> items = new ArrayList<String>(); - Iterator<Entry<String, List<String>>> it = this.disco.entrySet() - .iterator(); - while (it.hasNext()) { - Entry<String, List<String>> pairs = it.next(); - if (pairs.getValue().contains(feature)) { - items.add(pairs.getKey()); + for (Entry<String, List<String>> cursor : disco.entrySet()) { + if (cursor.getValue().contains(feature)) { + items.add(cursor.getKey()); } - it.remove(); } return items; } |