/** * Implements ChatSessionChangeListener#currentChatTransportChanged(ChatSession). * * @param chatSession the <tt>ChatSession</tt>, which transport has changed */ public void currentChatTransportChanged(ChatSession chatSession) { if (chatSession == null) return; ChatTransport currentTransport = chatSession.getCurrentChatTransport(); Object currentDescriptor = currentTransport.getDescriptor(); if (currentDescriptor instanceof Contact) { Contact contact = (Contact) currentDescriptor; for (PluginComponent c : pluginContainer.getPluginComponents()) c.setCurrentContact(contact); } }
/** * Implements ChatChangeListener#chatChanged(ChatPanel). * * @param chatPanel the <tt>ChatPanel</tt>, which changed */ public void chatChanged(ChatPanel chatPanel) { if (chatPanel == null) { setChatSession(null); } else { MetaContact contact = GuiActivator.getUIService().getChatContact(chatPanel); for (PluginComponent c : pluginContainer.getPluginComponents()) c.setCurrentContact(contact); ChatSession chatSession = chatPanel.getChatSession(); setChatSession(chatSession); leaveChatRoomButton.setEnabled(chatSession instanceof ConferenceChatSession); desktopSharingButton.setEnabled(!(chatSession instanceof ConferenceChatSession)); inviteButton.setEnabled(chatPanel.findInviteChatTransport() != null); sendFileButton.setEnabled(chatPanel.findFileTransferChatTransport() != null); inviteButton.setEnabled(!chatPanel.isPrivateMessagingChat()); if (chatSession instanceof ConferenceChatSession) { updateInviteContactButton(); callButton.setVisible(false); callVideoButton.setVisible(false); callButton.setEnabled(true); callVideoButton.setEnabled(true); } else if (contact != null) { callButton.setVisible(true); callVideoButton.setVisible(true); new UpdateCallButtonWorker(contact).start(); } changeHistoryButtonsState(chatPanel); setCallButtonsName(); setCallButtonsIcons(); currentChatTransportChanged(chatSession); } }
/** * Implements ChatChangeListener#chatChanged(ChatPanel). * * @param chatPanel the <tt>ChatPanel</tt>, which changed */ public void chatChanged(ChatPanel chatPanel) { if (chatPanel == null) { setChatSession(null); } else { MetaContact contact = GuiActivator.getUIService().getChatContact(chatPanel); for (PluginComponent c : pluginContainer.getPluginComponents()) c.setCurrentContact(contact); setChatSession(chatPanel.chatSession); leaveChatRoomButton.setEnabled(chatPanel.chatSession instanceof ConferenceChatSession); inviteButton.setEnabled(chatPanel.findInviteChatTransport() != null); sendFileButton.setEnabled(chatPanel.findFileTransferChatTransport() != null); new UpdateCallButtonWorker(contact).start(); changeHistoryButtonsState(chatPanel); } }