if(rsSubjectAccount == null) {
//They don't have an account by that name, check if it's a user
BNetUser bnSubject = source.getCreateBNetUser(params[0], user);
rsSubject = BNLogin.get(bnSubject);
if(rsSubject == null)
throw new NeverSeenUserException(bnSubject);
} else {
for(BNLogin login : rsSubjectAccount.getBnLogins()) {
Date nt = login.getLastSeen();
if((rsSubject == null)
|| ((nt != null) && (nt.compareTo(rsSubject.getLastSeen()) > 0)))
rsSubject = login;
}
if(rsSubject == null)
throw new NeverSeenUserException(rsSubjectAccount);
}
Date mostRecent = rsSubject.getLastSeen();
String mostRecentAction = rsSubject.getLastAction();
params[0] = new BNetUser(rsSubject.getLogin()).getShortLogonName(user);
if(mostRecent == null)
throw new NeverSeenUserException(params[0]);
String diff = TimeFormatter.formatTime(System.currentTimeMillis() - mostRecent.getTime());
diff = "User [" + params[0] + "] was last seen " + diff + " ago";
if(mostRecentAction != null)
diff += " " + mostRecentAction;