mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Use jxmpp-core (0.1.0-alpha1-SNAPSHOT)
fixes also SMACK-570, since jxmpp-core's XmppStringUtil contains the fix for SMACK-570.
This commit is contained in:
parent
8977f5b3f0
commit
f67d655fe7
34 changed files with 84 additions and 896 deletions
|
@ -26,7 +26,7 @@ import org.jivesoftware.smack.filter.PacketFilter;
|
|||
import org.jivesoftware.smack.filter.PacketTypeFilter;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jxmpp.util.XmppStringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -249,7 +249,7 @@ public class AgentRoster {
|
|||
private String getPresenceMapKey(String user) {
|
||||
String key = user;
|
||||
if (!contains(user)) {
|
||||
key = StringUtils.parseBareAddress(user).toLowerCase(Locale.US);
|
||||
key = XmppStringUtils.parseBareAddress(user).toLowerCase(Locale.US);
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
@ -317,13 +317,13 @@ public class AgentRoster {
|
|||
}
|
||||
// Add the new presence, using the resources as a key.
|
||||
synchronized (userPresences) {
|
||||
userPresences.put(StringUtils.parseResource(from), presence);
|
||||
userPresences.put(XmppStringUtils.parseResource(from), presence);
|
||||
}
|
||||
// Fire an event.
|
||||
synchronized (entries) {
|
||||
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
|
||||
String entry = i.next();
|
||||
if (entry.toLowerCase(Locale.US).equals(StringUtils.parseBareAddress(key).toLowerCase())) {
|
||||
if (entry.toLowerCase(Locale.US).equals(XmppStringUtils.parseBareAddress(key).toLowerCase())) {
|
||||
fireEvent(EVENT_PRESENCE_CHANGED, packet);
|
||||
}
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ public class AgentRoster {
|
|||
if (presenceMap.get(key) != null) {
|
||||
Map<String,Presence> userPresences = presenceMap.get(key);
|
||||
synchronized (userPresences) {
|
||||
userPresences.remove(StringUtils.parseResource(from));
|
||||
userPresences.remove(XmppStringUtils.parseResource(from));
|
||||
}
|
||||
if (userPresences.isEmpty()) {
|
||||
presenceMap.remove(key);
|
||||
|
@ -344,7 +344,7 @@ public class AgentRoster {
|
|||
synchronized (entries) {
|
||||
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
|
||||
String entry = (String)i.next();
|
||||
if (entry.toLowerCase(Locale.US).equals(StringUtils.parseBareAddress(key).toLowerCase())) {
|
||||
if (entry.toLowerCase(Locale.US).equals(XmppStringUtils.parseBareAddress(key).toLowerCase())) {
|
||||
fireEvent(EVENT_PRESENCE_CHANGED, packet);
|
||||
}
|
||||
}
|
||||
|
@ -368,8 +368,8 @@ public class AgentRoster {
|
|||
|
||||
// Removing the user from the roster, so remove any presence information
|
||||
// about them.
|
||||
String key = StringUtils.parseName(StringUtils.parseName(agentJID) + "@" +
|
||||
StringUtils.parseServer(agentJID));
|
||||
String key = XmppStringUtils.parseLocalpart(XmppStringUtils.parseLocalpart(agentJID) + "@" +
|
||||
XmppStringUtils.parseDomain(agentJID));
|
||||
presenceMap.remove(key);
|
||||
// Fire event for roster listeners.
|
||||
fireEvent(EVENT_AGENT_REMOVED, agentJID);
|
||||
|
|
|
@ -39,7 +39,7 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
|||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.filter.*;
|
||||
import org.jivesoftware.smack.packet.*;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jxmpp.util.XmppStringUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
@ -478,7 +478,7 @@ public class AgentSession {
|
|||
* @throws SmackException
|
||||
*/
|
||||
public Form getTranscriptSearchForm() throws XMPPException, SmackException {
|
||||
return transcriptSearchManager.getSearchForm(StringUtils.parseServer(workgroupJID));
|
||||
return transcriptSearchManager.getSearchForm(XmppStringUtils.parseDomain(workgroupJID));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -492,7 +492,7 @@ public class AgentSession {
|
|||
* @throws XMPPException
|
||||
*/
|
||||
public ReportedData searchTranscripts(Form completedForm) throws XMPPException, SmackException {
|
||||
return transcriptSearchManager.submitSearch(StringUtils.parseServer(workgroupJID),
|
||||
return transcriptSearchManager.submitSearch(XmppStringUtils.parseDomain(workgroupJID),
|
||||
completedForm);
|
||||
}
|
||||
|
||||
|
@ -686,7 +686,7 @@ public class AgentSession {
|
|||
// check for different packet extensions to see what type of presence
|
||||
// packet it is.
|
||||
|
||||
String queueName = StringUtils.parseResource(presence.getFrom());
|
||||
String queueName = XmppStringUtils.parseResource(presence.getFrom());
|
||||
WorkgroupQueue queue = queues.get(queueName);
|
||||
// If there isn't already an entry for the queue, create a new one.
|
||||
if (queue == null) {
|
||||
|
|
|
@ -34,11 +34,11 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
|||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.filter.*;
|
||||
import org.jivesoftware.smack.packet.*;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.muc.MultiUserChat;
|
||||
import org.jivesoftware.smackx.muc.packet.MUCUser;
|
||||
import org.jxmpp.util.XmppStringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
@ -664,7 +664,7 @@ public class Workgroup {
|
|||
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection);
|
||||
|
||||
try {
|
||||
String workgroupService = StringUtils.parseServer(workgroupJID);
|
||||
String workgroupService = XmppStringUtils.parseDomain(workgroupJID);
|
||||
DiscoverInfo infoResult = discoManager.discoverInfo(workgroupService);
|
||||
return infoResult.containsFeature("jive:email:provider");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue