| 74 | } |
| 75 | |
| 76 | public void receivedMsg(String id, String msg, int type) { |
| 77 | if (chattingPanel.get(id) == null) { |
| 78 | Friend sender = new Friend(id, "匿名"); |
| 79 | for (Friend fri : this.friendGUI.friendsList) { |
| 80 | if (fri.id.equals(id)) { |
| 81 | sender.nickName = fri.nickName; |
| 82 | sender.state = 1; |
| 83 | break; |
| 84 | } |
| 85 | } |
| 86 | chattingPanel.put(id, new ChattingGUI(this, sender)); |
| 87 | } |
| 88 | chattingPanel.get(id).receiveMsg(msg, type); |
| 89 | } |
| 90 | |
| 91 | public boolean sendMsg(String id, String msg, int type) throws Exception { |
| 92 | client.sendMsg(id, msg, type); |