public void broadcastMyIpAddress(String user, int status) throws Exception { if (status == Constants.STATUS_ONLINE || status == Constants.STATUS_AWAY || status == Constants.STATUS_BUSY) { LoginInfo info = context.getDataManager().getValue(Constants.DataKey.LOGGININFO.toString()); MemberBean bean = new MemberBean(); bean.setLccAccount(info.getUsername()); String[] allLocalHostIP = NetworkUtil.getAllLocalHostIP(); for (int i = 0; i < allLocalHostIP.length; i++) { log.info(i + " : " + allLocalHostIP[i]); } int networkinterfaceIndex = Vovo.getConfigManager().getIntProperty("networkinterfaceIndex", 0); bean.setIp(allLocalHostIP[networkinterfaceIndex]); Vovo.getLcmUtil().broadcastMyIpAddress(bean, info.getUsername(), user); log.info("vovo broadcastMyIpAddress " + bean + "," + info.getUsername() + "," + user); } }
private void handleFriendMsg( FriendChatPanel panel, MemberBean memberBean, String msg, FontStyle fontStyle, Date sendDate, Map<String, String> imgs) throws Exception { panel.insertFriendMsg(msg, fontStyle, sendDate, imgs); FlashWindowUtil.start(getMessageFrame()); ChatRecord c = new ChatRecord( memberBean.getId(), memberBean.getRealName(), msg, sendDate, fontStyle, getSessionID(memberBean.getId())); Vovo.exeS("dataStore", "saveChatRecord", c); }
public void showFriendChat(MemberBean bean) { MessageFrame msgFrame = getMessageFrame(); getFriendChatPanel(bean); String key = Constants.FRIEND_CHAT_SESSION_PREFIX + bean.getLccAccount(); ControllerEvent event = new ControllerEvent(); event.setExClass("chat"); event.setExMethod("showNotReadMessage"); event.setParas(new Object[] {key}); MyTrayIcon trayIcon = context.getViewManager().getView(Constants.ViewKey.TRAYICON.toString()); trayIcon.removeEvent(event); showNotReadMessage(key); msgFrame.setExtendedState(JFrame.NORMAL); msgFrame.setVisible(true); }
public FriendChatPanel getFriendChatPanel(MemberBean bean) { String sessionID = getSessionID(bean.getId()); MessageTabPanel tabPanel = context.getViewManager().getView(Constants.ViewKey.MESSAGETABPANEL.toString()); FriendChatPanel panel = (FriendChatPanel) tabPanel.getTab(sessionID); if (panel == null) { panel = new FriendChatPanel(); panel.setInfo(bean); // ImageIcon icon = new // ImageIcon(getClass().getResource("/com/lorent/vovo/resource/images/systemheads/default40.png")); tabPanel.addTab(panel, bean, sessionID); } else { tabPanel.setNoticeTab(sessionID); } return panel; }