MCPcopy Create free account
hub / github.com/Giyn/LiveChat / sendMsg

Method sendMsg

src/pers/giyn/LiveChat/GUI/chat/ChattingGUI.java:242–261  ·  view source on GitHub ↗
(String msg, int type)

Source from the content-addressed store, hash-verified

240 }
241
242 public void sendMsg(String msg, int type) {
243 try {
244 if (type != 3) {
245 callback.sendMsg(this.friend.id, msg, type);
246 }
247 this.chattingPanel.addSent(msg, type);
248 if (type == 1) {
249 chattingRecords.add(new ChattingRecord(callback.id, "", msg, (byte) 0));
250 } else {
251 if (type == 2) {
252 chattingRecords.add(new ChattingRecord(callback.id, "", msg, (byte) 2));
253 } else if (type == 3) {
254 chattingRecords.add(new ChattingRecord(callback.id, "", msg, (byte) 4));
255 }
256 }
257 } catch (Exception e) {
258 e.printStackTrace();
259 }
260 jScrollPane.getViewport().setViewPosition(new Point(0, jScrollPane.getVerticalScrollBar().getMaximum()));
261 }
262
263 public void receiveMsg(String msg, int type) {
264 this.chattingPanel.addReceived(msg, type);

Callers 1

actionPerformedMethod · 0.95

Calls 1

addSentMethod · 0.80

Tested by

no test coverage detected