mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
SPARK-2157: Prevent comparing JID with String for FastPath agent
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>fastpath</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<version>3.5.1</version>
|
||||
|
||||
<name>Fastpath</name>
|
||||
<description>Provides FastPath Agent functionality.</description>
|
||||
|
||||
@ -30,7 +30,7 @@ import java.awt.Insets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.jivesoftware.spark.UserManager;
|
||||
import org.jxmpp.jid.EntityBareJid;
|
||||
|
||||
public class AgentConversation extends JPanel {
|
||||
|
||||
@ -42,10 +42,9 @@ public class AgentConversation extends JPanel {
|
||||
private JLabel questionLabel = new JLabel();
|
||||
|
||||
private String sessionID;
|
||||
private String agentJID;
|
||||
private EntityBareJid agentJID;
|
||||
|
||||
public AgentConversation(String agent, String visitor, Date date, String email, String question, String sessionID) {
|
||||
agent = UserManager.unescapeJID(agent);
|
||||
public AgentConversation( EntityBareJid agent, String visitor, Date date, String email, String question, String sessionID) {
|
||||
this.agentJID = agent;
|
||||
|
||||
setBackground(Color.white);
|
||||
@ -89,7 +88,7 @@ public class AgentConversation extends JPanel {
|
||||
final SimpleDateFormat simpleFormat = new SimpleDateFormat("MM/dd/yyyy h:mm a");
|
||||
String theDate = simpleFormat.format(date);
|
||||
|
||||
agentLabel.setText(agent);
|
||||
agentLabel.setText(agent.asUnescapedString());
|
||||
visitorLabel.setText(visitor);
|
||||
dateLabel.setText(theDate);
|
||||
emailLabel.setText(email);
|
||||
@ -98,11 +97,11 @@ public class AgentConversation extends JPanel {
|
||||
setSessionID(sessionID);
|
||||
}
|
||||
|
||||
public String getAgentJID() {
|
||||
public EntityBareJid getAgentJID() {
|
||||
return agentJID;
|
||||
}
|
||||
|
||||
public void setAgentJID(String agentJID) {
|
||||
public void setAgentJID(EntityBareJid agentJID) {
|
||||
this.agentJID = agentJID;
|
||||
}
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ public final class AgentConversations extends JPanel implements ChangeListener {
|
||||
}
|
||||
|
||||
|
||||
private void addAgentChat(String agentID, String name, String email, String question, Date startDate, String sessionID) {
|
||||
private void addAgentChat(EntityBareJid agentID, String name, String email, String question, Date startDate, String sessionID) {
|
||||
if (sessionMap.containsKey(sessionID)) {
|
||||
return;
|
||||
}
|
||||
@ -219,7 +219,7 @@ public final class AgentConversations extends JPanel implements ChangeListener {
|
||||
if (!ModelUtil.hasLength(email)) {
|
||||
email = "Not specified";
|
||||
}
|
||||
addAgentChat(agentJID.toString(), nickname, email, question, startDate, chatInfo.getSessionID());
|
||||
addAgentChat(agentJID, nickname, email, question, startDate, chatInfo.getSessionID());
|
||||
}
|
||||
}
|
||||
calculateNumberOfChats(agentRoster);
|
||||
@ -265,7 +265,7 @@ public final class AgentConversations extends JPanel implements ChangeListener {
|
||||
|
||||
private void removeOldChats(EntityBareJid agentJID, List chatList) {
|
||||
for (AgentConversation agent : sessionMap.values()) {
|
||||
if (agent.getAgentJID().toString().equals(agentJID)) {
|
||||
if (agent.getAgentJID().equals(agentJID)) {
|
||||
String sessionID = agent.getSessionID();
|
||||
boolean listHasID = newListHasSession(sessionID, chatList);
|
||||
if (!listHasID) {
|
||||
|
||||
Reference in New Issue
Block a user