From b656a44e2441c6bf9db8773594bc9abf2c38cd21 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Fri, 10 May 2024 12:46:39 +0100 Subject: Implement remaining group chat responses --- src/com/wilko/jaimtest/JaimTest.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/com/wilko/jaimtest') diff --git a/src/com/wilko/jaimtest/JaimTest.java b/src/com/wilko/jaimtest/JaimTest.java index 2df11f9..e888e2d 100644 --- a/src/com/wilko/jaimtest/JaimTest.java +++ b/src/com/wilko/jaimtest/JaimTest.java @@ -135,7 +135,13 @@ public class JaimTest implements JaimEventListener { } else if (responseType.equalsIgnoreCase(ConnectionLostTocResponse.RESPONSE_TYPE)) { System.out.println("Connection lost!"); } else if (responseType.equalsIgnoreCase(ChatInviteTocResponse.RESPONSE_TYPE)) { - recieveChatInvite((ChatInviteTocResponse) tr); + receiveChatInvite((ChatInviteTocResponse) tr); + } else if (responseType.equalsIgnoreCase(ChatBuddyUpdateTocResponse.RESPONSE_TYPE)) { + receiveChatBuddyUpdate((ChatBuddyUpdateTocResponse) tr); + } else if (responseType.equalsIgnoreCase(ChatJoinTocResponse.RESPONSE_TYPE)) { + receiveChatJoin((ChatJoinTocResponse) tr); + } else if (responseType.equalsIgnoreCase(ChatMessageTocResponse.RESPONSE_TYPE)) { + receiveChatMessage((ChatMessageTocResponse) tr); } else { System.out.println("Unknown TOC Response:" + tr); } @@ -156,6 +162,10 @@ public class JaimTest implements JaimEventListener { } } + private void receiveChatMessage(ChatMessageTocResponse message) { + System.out.println(message.getScreenname() + "@" + message.getRoomID() + "->" + Utils.stripHTML(message.getMessage())); + } + private void receiveBuddyUpdate(BuddyUpdateTocResponse bu) { System.out.println("Buddy update: " + bu.getBuddy()); if (bu.isOnline()) { @@ -209,7 +219,7 @@ public class JaimTest implements JaimEventListener { } } - private void recieveChatInvite(ChatInviteTocResponse inviteTocResponse) { + private void receiveChatInvite(ChatInviteTocResponse inviteTocResponse) { c.joinChat(inviteTocResponse.getRoomName()); } @@ -241,5 +251,11 @@ public class JaimTest implements JaimEventListener { } } + private void receiveChatBuddyUpdate(ChatBuddyUpdateTocResponse tr) { + System.out.println("Buddies " + (tr.getType()) + " " + tr.getRoomID() + ": " + String.join(", ", tr.getScreennames())); + } + private void receiveChatJoin(ChatJoinTocResponse tr) { + System.out.println("Joined " + tr.getRoomName()); + } } -- cgit v1.2.3-54-g00ecf