mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
Smack 4.2.0
-----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAljDKBtfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF IFJB7Qf6AlkwpzMqq1g18jzEBFVX/3Sk2QWivEY7t3EhGuSguan2VIfd1fL0P85Q vLBm6Pw93haIxHXKRUKc8DINwP9yuRMvUotCN2hYVgfqfByHGhDCJLTNZ9atncL5 JToptfhdRy6kgljVZPtpXOMXKBvaO3QOuTuC5cmz8PlidsYw0yUnliPLQ36uPRWX eaEXXbgmkjJh35WjsaafD/uM86OCqZahfvEf3e8bkPzdAayd0OKU67+v0ArA9P2E CiRU5vfco/vt2Qo41aLLIEOjSFfVX6Xh/pXxfQvInMAxies0KRLi5vonOmfrWRmi uIblzcYRXCSaZSgVN2yF8KzmF4pzcw== =qETn -----END PGP SIGNATURE----- Merge tag '4.2.0' Smack 4.2.0
This commit is contained in:
commit
1a93b448db
51 changed files with 1996 additions and 218 deletions
|
@ -43,7 +43,10 @@ import org.jivesoftware.smack.filter.FromMatchesFilter;
|
|||
import org.jivesoftware.smack.filter.MessageTypeFilter;
|
||||
import org.jivesoftware.smack.filter.MessageWithSubjectFilter;
|
||||
import org.jivesoftware.smack.filter.NotFilter;
|
||||
import org.jivesoftware.smack.filter.OrFilter;
|
||||
import org.jivesoftware.smack.filter.PresenceTypeFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaIdFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaExtensionFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaTypeFilter;
|
||||
import org.jivesoftware.smack.filter.ToMatchesFilter;
|
||||
|
@ -327,9 +330,17 @@ public class MultiUserChat {
|
|||
messageCollector = connection.createStanzaCollector(fromRoomGroupchatFilter);
|
||||
|
||||
// Wait for a presence packet back from the server.
|
||||
// Use a bare JID filter, since the room may rewrite the nickname.
|
||||
StanzaFilter responseFilter = new AndFilter(FromMatchesFilter.createBare(getRoom()), new StanzaTypeFilter(
|
||||
Presence.class), MUCUserStatusCodeFilter.STATUS_110_PRESENCE_TO_SELF);
|
||||
// @formatter:off
|
||||
StanzaFilter responseFilter = new AndFilter(StanzaTypeFilter.PRESENCE,
|
||||
new OrFilter(
|
||||
// We use a bare JID filter for positive responses, since the MUC service/room may rewrite the nickname.
|
||||
new AndFilter(FromMatchesFilter.createBare(getRoom()), MUCUserStatusCodeFilter.STATUS_110_PRESENCE_TO_SELF),
|
||||
// In case there is an error reply, we match on an error presence with the same stanza id and from the full
|
||||
// JID we send the join presence to.
|
||||
new AndFilter(FromMatchesFilter.createFull(joinPresence.getTo()), new StanzaIdFilter(joinPresence), PresenceTypeFilter.ERROR)
|
||||
)
|
||||
);
|
||||
// @formatter:on
|
||||
Presence presence;
|
||||
try {
|
||||
presence = connection.createStanzaCollectorAndSend(responseFilter, joinPresence).nextResultOrThrow(conf.getTimeout());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2012-2015 Florian Schmaus
|
||||
* Copyright 2012-2017 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -16,11 +16,10 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.ping;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
@ -105,8 +104,7 @@ public final class PingManager extends Manager {
|
|||
defaultPingInterval = interval;
|
||||
}
|
||||
|
||||
private final Set<PingFailedListener> pingFailedListeners = Collections
|
||||
.synchronizedSet(new HashSet<PingFailedListener>());
|
||||
private final Set<PingFailedListener> pingFailedListeners = new CopyOnWriteArraySet<>();
|
||||
|
||||
private final ScheduledExecutorService executorService;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue