diff options
author | Frankie B <git@diskfloppy.me> | 2024-05-10 12:46:39 +0100 |
---|---|---|
committer | Frankie B <git@diskfloppy.me> | 2024-05-10 12:46:39 +0100 |
commit | b656a44e2441c6bf9db8773594bc9abf2c38cd21 (patch) | |
tree | eefa7639f352f3f80ed7c3681b38f27121d5b466 /src/com/wilko/jaimtest | |
parent | d73fb78686e827360d90d91483e17c9ebd04e462 (diff) |
Implement remaining group chat responses
Diffstat (limited to 'src/com/wilko/jaimtest')
-rw-r--r-- | src/com/wilko/jaimtest/JaimTest.java | 20 |
1 files changed, 18 insertions, 2 deletions
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()); + } } |