Received messages from different contacts appear in the same tab - the current one. Trying to solve the problem.

cusax-fix
Yana Stamcheva 20 years ago
parent 60b5576353
commit a16b56bc23

@ -287,7 +287,7 @@ public void windowClosing(WindowEvent e) {
Hashtable contactTabsTable
= tabbedChatWindow.getContactTabsTable();
if(contactTabsTable.get(this.contactItem.getDisplayName())
if(contactTabsTable.get(this.contactItem.getMetaUID())
== null){
// If there's no open tab for the given contact.
@ -433,7 +433,7 @@ public void windowClosing(WindowEvent e) {
Hashtable contactTabsTable
= tabbedChatWindow.getContactTabsTable();
if(contactTabsTable.get(metaContact.getDisplayName())
if(contactTabsTable.get(metaContact.getMetaUID())
== null){
// If there's no open tab for the given contact.
tabbedChatWindow.addChatTab(metaContact, contactStatus);
@ -560,7 +560,7 @@ else if(tabbedChatWindow != null){
Hashtable contactTabsTable
= tabbedChatWindow.getContactTabsTable();
if(contactTabsTable.get(metaContact.getDisplayName())
if(contactTabsTable.get(metaContact.getMetaUID())
!= null){
tabbedChatWindow.getChatPanel(metaContact)
@ -589,7 +589,7 @@ else if(tabbedChatWindow != null && tabbedChatWindow.getTabCount() > 0){
= tabbedChatWindow.getContactTabsTable();
ChatPanel chatPanel
= (ChatPanel)contactTabsTable.get(metaContact.getDisplayName());
= (ChatPanel)contactTabsTable.get(metaContact.getMetaUID());
if(chatPanel != null){
int contactTabIndex = tabbedChatWindow.getTabInex(metaContact);

@ -255,7 +255,7 @@ public void closeOperation(MouseEvent e){
//Set the tab index even it's not yet shown in tabbed pane
this.currentChatPanel.setTabIndex(0);
this.contactTabsTable.put(contact.getDisplayName(),
this.contactTabsTable.put(contact.getMetaUID(),
currentChatPanel);
this.setTitle(contact.getDisplayName());
@ -280,7 +280,7 @@ public void closeOperation(MouseEvent e){
this.currentChatPanel
.setTabIndex(chatTabbedPane.getTabCount() - 1);
this.contactTabsTable.put(contact.getDisplayName(),
this.contactTabsTable.put(contact.getMetaUID(),
currentChatPanel);
}
else{
@ -306,7 +306,7 @@ public void closeOperation(MouseEvent e){
currentChatPanel
.setTabIndex(chatTabbedPane.getTabCount() - 1);
this.contactTabsTable.put(contact.getDisplayName(),
this.contactTabsTable.put(contact.getMetaUID(),
currentChatPanel);
}
@ -325,7 +325,7 @@ public void setSelectedContactTab(MetaContact contact){
if(this.contactTabsTable != null && !this.contactTabsTable.isEmpty()){
ChatPanel chatPanel = ((ChatPanel)this.contactTabsTable
.get(contact.getDisplayName()));
.get(contact.getMetaUID()));
this.chatTabbedPane.setSelectedIndex(chatPanel.getTabIndex());
chatPanel.getWriteMessagePanel()
@ -358,9 +358,11 @@ public void removeContactTab(int index){
String title = chatTabbedPane.getTitleAt(index);
ChatPanel selectedChat = (ChatPanel)chatTabbedPane.getComponentAt(index);
if(title != null){
if(chatTabbedPane.getTabCount() > 1)
this.contactTabsTable.remove(title);
this.contactTabsTable.remove(selectedChat.getDefaultContact().getMetaUID());
Enumeration contactTabs = this.contactTabsTable.elements();
@ -388,13 +390,13 @@ public void removeContactTab(int index){
String onlyTabtitle = chatTabbedPane.getTitleAt(0);
ChatPanel chatPanel
= (ChatPanel)this.chatTabbedPane.getComponentAt(0);
this.getContentPane().remove(chatTabbedPane);
this.chatTabbedPane.removeAll();
ChatPanel chatPanel
= (ChatPanel)this.contactTabsTable.get(onlyTabtitle);
this.getContentPane().add(chatPanel, BorderLayout.CENTER);
this.setCurrentChatPanel(chatPanel);
@ -450,7 +452,7 @@ public int getTabCount(){
*/
public int getTabInex(MetaContact contact){
return ((ChatPanel)this.contactTabsTable
.get(contact.getDisplayName())).getTabIndex();
.get(contact.getMetaUID())).getTabIndex();
}
/**
@ -469,7 +471,7 @@ public void highlightTab(MetaContact contact){
* @return ChatPanel The ChatPanel for the given MetaContact.
*/
public ChatPanel getChatPanel(MetaContact contact){
return (ChatPanel)this.contactTabsTable.get(contact.getDisplayName());
return (ChatPanel)this.contactTabsTable.get(contact.getMetaUID());
}
/**

Loading…
Cancel
Save