Fixes status change problems in chat window. Includes fixes for multiple

status messages and status icon incorrect changes reported by Richard
Karmazín.
cusax-fix
yanas 13 years ago
parent a9c65e9cd3
commit 972d72fcfb

@ -24,9 +24,9 @@ h3
h4 h4
{ {
margin: 0px; margin: 0px;
font-size: 100%; font-size: 8px;
font-weight: bold; font-weight: normal;
color: #FFC875; color: #8F8F8F;
} }
h5 h5

@ -1989,6 +1989,9 @@ public void run()
writeMessagePanel.updateChatTransportStatus(chatTransport); writeMessagePanel.updateChatTransportStatus(chatTransport);
if (!chatTransport.equals(chatSession.getCurrentChatTransport()))
return;
if(ConfigurationUtils.isShowStatusChangedInChat()) if(ConfigurationUtils.isShowStatusChangedInChat())
{ {
// Show a status message to the user. // Show a status message to the user.
@ -2002,13 +2005,22 @@ public void run()
"text/plain"); "text/plain");
} }
setChatIcon(new ImageIcon(
Constants.getStatusIcon(chatTransport.getStatus())));
}
/**
* Sets the chat icon.
*
* @param icon the chat icon to set
*/
public void setChatIcon(Icon icon)
{
if(ConfigurationUtils.isMultiChatWindowEnabled()) if(ConfigurationUtils.isMultiChatWindowEnabled())
{ {
if (getChatContainer().getChatCount() > 0) if (getChatContainer().getChatCount() > 0)
{ {
getChatContainer().setChatIcon(this, getChatContainer().setChatIcon(this, icon);
new ImageIcon(
Constants.getStatusIcon(chatTransport.getStatus())));
} }
} }
} }

@ -6,6 +6,8 @@
*/ */
package net.java.sip.communicator.impl.gui.main.chat; package net.java.sip.communicator.impl.gui.main.chat;
import javax.swing.*;
/** /**
* The <tt>ChatSessionRenderer</tt> is the connector between the * The <tt>ChatSessionRenderer</tt> is the connector between the
* <tt>ChatSession</tt> and the <tt>ChatPanel</tt>, which represents the UI * <tt>ChatSession</tt> and the <tt>ChatPanel</tt>, which represents the UI
@ -85,4 +87,11 @@ public void updateChatContactStatus(ChatContact<?> chatContact,
* @param subject the new subject to set. * @param subject the new subject to set.
*/ */
public void setChatSubject(String subject); public void setChatSubject(String subject);
/**
* Sets the chat icon.
*
* @param icon the chat icon to set
*/
public void setChatIcon(Icon icon);
} }

@ -202,6 +202,10 @@ public void actionPerformed(ActionEvent e)
chatTransport, chatTransport,
(ImageIcon) menuItem.getIcon()); (ImageIcon) menuItem.getIcon());
chatSession.getChatSessionRenderer()
.setChatIcon(new ImageIcon(
Constants.getStatusIcon(chatTransport.getStatus())));
return; return;
} }
} }

@ -686,7 +686,10 @@ public void contactPresenceStatusChanged(
ContactPresenceStatusChangeEvent evt) ContactPresenceStatusChangeEvent evt)
{ {
if (evt.getSourceContact().equals(contact) if (evt.getSourceContact().equals(contact)
&& !evt.getOldStatus().equals(evt.getNewStatus())) && !evt.getOldStatus().equals(evt.getNewStatus())
&& contactResource == null) // If the contact source is set then the
// status will be updated from the
// MetaContactChatSession.
{ {
this.updateContactStatus(); this.updateContactStatus();
} }

Loading…
Cancel
Save