Can't you just use the second code Cookie posted?
code:
var aSent = new Array();
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
aSent[ChatWnd.Handle] = Message;
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
if (aSent[ChatWnd.Handle] === Message) {
delete aSent[ChatWnd.Handle];
} else {
// a contact sent the message, so do whatever
}
}
doesn't check for any nicknames at all...