The AIMTest client does not access the correct
protocol. It accesses protocols[0] which is Yahoo,
instead of protocol[2] which is AIM. Ideally it
shouldn't be accessing them by index, or the indexes
shouldn't be changing, but hey!
Patch follows
************************
Index: AIMTestClient.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 AIMTestClient.java
--- AIMTestClient.java 26 Jul 2003 04:26:45 -0000 1.1
+++ AIMTestClient.java 1 Feb 2004 04:09:08 -0000
@@ -21,14 +21,14 @@
*/
public AIMTestClient() throws Exception {
protocols =
ProtocolManager.getAvailableProtocols();
- Protocol prot = protocols[0];
+ Protocol prot = protocols[2];
prot.setListener(new AIMListener());
//BufferedReader rd = new BufferedReader(new
InputStreamReader(System.in));
//System.out.print("Username: ");
//String username = rd.readLine();
- String username = "xxxxx";
- String password = "xxxxx";
+ String username = "headiusmaximus";
+ String password = "reveal";
//PasswordField passfield = new PasswordField();
//String password = null;
@@ -84,40 +84,40 @@
for (int i = 2; i < words.length; i++)
msgText += words[i] + " ";
- Buddy buddy = new Buddy(protocols[0],
words[1]);
+ Buddy buddy = new Buddy(protocols[2],
words[1]);
Message msg = new Message();
msg.addComponent(new
TextComponent(msgText));
- protocols[0].sendInstantMessage(buddy,
msg);
+ protocols[2].sendInstantMessage(buddy,
msg);
}
} else if (words[0].equals("add")) {
if (words.length == 2) {
- Buddy buddy = new Buddy(protocols[0],
words[1], "Friends");
+ Buddy buddy = new Buddy(protocols[2],
words[1], "Friends");
buddy.addToBuddyList();
}
} else if (words[0].equals("del")) {
if (words.length == 2) {
- Buddy buddy = new Buddy(protocols[0],
words[1], "Friends");
+ Buddy buddy = new Buddy(protocols[2],
words[1], "Friends");
buddy.deleteFromBuddyList();
}
} else if (words[0].equals("ign")) {
if (words.length == 2) {
- Buddy buddy = new Buddy(protocols[0],
words[1]);
+ Buddy buddy = new Buddy(protocols[2],
words[1]);
buddy.ignore();
}
} else if (words[0].equals("uign")) {
if (words.length == 2) {
- Buddy buddy = new Buddy(protocols[0],
words[1]);
+ Buddy buddy = new Buddy(protocols[2],
words[1]);
buddy.unignore();
}
// } else if (words[0].equals("cnf")) {
// if (words.length > 2) {
-// Buddy myself = new
Buddy(protocols[0], words[1]);
+// Buddy myself = new
Buddy(protocols[2], words[1]);
// Buddy[] buddies = new
Buddy[words.length - 1];
// for (int i = 0; i < buddies.length; i++)
-// buddies[i] = new
Buddy(protocols[0], words[i + 1]);
+// buddies[i] = new
Buddy(protocols[2], words[i + 1]);
// String message = "Friends, Romans,
and Countrymen, lend me your IMs";
-// conf = new Conference(protocols[0],
myself, buddies, message);
+// conf = new Conference(protocols[2],
myself, buddies, message);
// }
// } else if (words[0].equals("cmsg")) {
// if (words.length == 2) {
@@ -129,7 +129,7 @@
// } else if (words[0].equals("cnfq")) {
// conf.quit();
} else if (words[0].equals("off")) {
- protocols[0].disconnect();
+ protocols[2].disconnect();
return true;
}
****************************************
Logged In: YES
user_id=666257
Your comment is correct, but the AIMTestClient is only around
for testing only the AIM implementation of the Protocol.
Someone probably re-checked this in incorrectly.