mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-12 08:01:08 +01:00
Bump jxmpp to 0.5.0-alpha4
This commit is contained in:
parent
8840236b72
commit
c125a3b055
49 changed files with 208 additions and 208 deletions
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smack.PacketCollector;
|
|||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jxmpp.jid.JidWithLocalpart;
|
||||
import org.jxmpp.jid.EntityJid;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Collections;
|
||||
|
|
@ -41,7 +41,7 @@ public class Chat {
|
|||
|
||||
private ChatManager chatManager;
|
||||
private String threadID;
|
||||
private JidWithLocalpart participant;
|
||||
private EntityJid participant;
|
||||
private final Set<ChatMessageListener> listeners = new CopyOnWriteArraySet<ChatMessageListener>();
|
||||
|
||||
/**
|
||||
|
|
@ -51,7 +51,7 @@ public class Chat {
|
|||
* @param participant the user to chat with.
|
||||
* @param threadID the thread ID to use.
|
||||
*/
|
||||
Chat(ChatManager chatManager, JidWithLocalpart participant, String threadID) {
|
||||
Chat(ChatManager chatManager, EntityJid participant, String threadID) {
|
||||
if (StringUtils.isEmpty(threadID)) {
|
||||
throw new IllegalArgumentException("Thread ID must not be null");
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ public class Chat {
|
|||
*
|
||||
* @return the name of the user the chat is occuring with.
|
||||
*/
|
||||
public JidWithLocalpart getParticipant() {
|
||||
public EntityJid getParticipant() {
|
||||
return participant;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ import org.jivesoftware.smack.filter.ThreadFilter;
|
|||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.Message.Type;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jxmpp.jid.BareJid;
|
||||
import org.jxmpp.jid.EntityBareJid;
|
||||
import org.jxmpp.jid.Jid;
|
||||
import org.jxmpp.jid.JidWithLocalpart;
|
||||
import org.jxmpp.jid.EntityJid;
|
||||
|
||||
/**
|
||||
* The chat manager keeps track of references to all current chats. It will not hold any references
|
||||
|
|
@ -135,7 +135,7 @@ public final class ChatManager extends Manager{
|
|||
/**
|
||||
* Maps base jids to chats
|
||||
*/
|
||||
private Map<BareJid, Chat> baseJidChats = new ConcurrentHashMap<>();
|
||||
private Map<EntityBareJid, Chat> baseJidChats = new ConcurrentHashMap<>();
|
||||
|
||||
private Set<ChatManagerListener> chatManagerListeners
|
||||
= new CopyOnWriteArraySet<ChatManagerListener>();
|
||||
|
|
@ -217,7 +217,7 @@ public final class ChatManager extends Manager{
|
|||
* @param userJID the user this chat is with.
|
||||
* @return the created chat.
|
||||
*/
|
||||
public Chat createChat(JidWithLocalpart userJID) {
|
||||
public Chat createChat(EntityJid userJID) {
|
||||
return createChat(userJID, null);
|
||||
}
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ public final class ChatManager extends Manager{
|
|||
* @param listener the optional listener which will listen for new messages from this chat.
|
||||
* @return the created chat.
|
||||
*/
|
||||
public Chat createChat(JidWithLocalpart userJID, ChatMessageListener listener) {
|
||||
public Chat createChat(EntityJid userJID, ChatMessageListener listener) {
|
||||
return createChat(userJID, null, listener);
|
||||
}
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ public final class ChatManager extends Manager{
|
|||
* @param listener the optional listener to add to the chat
|
||||
* @return the created chat.
|
||||
*/
|
||||
public Chat createChat(JidWithLocalpart userJID, String thread, ChatMessageListener listener) {
|
||||
public Chat createChat(EntityJid userJID, String thread, ChatMessageListener listener) {
|
||||
if (thread == null) {
|
||||
thread = nextID();
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ public final class ChatManager extends Manager{
|
|||
return chat;
|
||||
}
|
||||
|
||||
private Chat createChat(JidWithLocalpart userJID, String threadID, boolean createdLocally) {
|
||||
private Chat createChat(EntityJid userJID, String threadID, boolean createdLocally) {
|
||||
Chat chat = new Chat(this, userJID, threadID);
|
||||
threadChats.put(threadID, chat);
|
||||
jidChats.put(userJID, chat);
|
||||
|
|
@ -268,7 +268,7 @@ public final class ChatManager extends Manager{
|
|||
|
||||
void closeChat(Chat chat) {
|
||||
threadChats.remove(chat.getThreadID());
|
||||
JidWithLocalpart userJID = chat.getParticipant();
|
||||
EntityJid userJID = chat.getParticipant();
|
||||
jidChats.remove(userJID);
|
||||
baseJidChats.remove(userJID.withoutResource());
|
||||
}
|
||||
|
|
@ -288,7 +288,7 @@ public final class ChatManager extends Manager{
|
|||
return null;
|
||||
}
|
||||
|
||||
JidWithLocalpart userJID = from.asJidWithLocalpartIfPossible();
|
||||
EntityJid userJID = from.asEntityJidIfPossible();
|
||||
if (userJID == null) {
|
||||
LOGGER.warning("Message from JID without localpart: '" +message.toXML() + "'");
|
||||
return null;
|
||||
|
|
@ -322,7 +322,7 @@ public final class ChatManager extends Manager{
|
|||
Chat match = jidChats.get(userJID);
|
||||
|
||||
if (match == null && (matchMode == MatchMode.BARE_JID)) {
|
||||
match = baseJidChats.get(userJID.asBareJidIfPossible());
|
||||
match = baseJidChats.get(userJID.asEntityBareJidIfPossible());
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue