aboutsummaryrefslogtreecommitdiff
path: root/src/com/wilko/jaimtest
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/wilko/jaimtest')
-rw-r--r--src/com/wilko/jaimtest/JaimTest.java20
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());
+ }
}