private String resolveSkypeIdOf(String to) throws SkypeException { for (Friend f : com.skype.Skype.getContactList().getAllFriends()) { if (f.getFullName().equals(to) || f.getId().equals(to)) return f.getId(); } throw new IllegalStateException("User " + to + " not found"); }
private boolean internalIsKnownUser(String user) { try { for (Friend f : com.skype.Skype.getContactList().getAllFriends()) { if (f.getFullName().equals(user) || f.getId().equals(user)) return true; } } catch (SkypeException e) { throw new UnhandledException(e); } return false; }
private void add(String arg) throws SkypeException { Skype.getContactList().addFriend(arg, "Hello, I'd like to add you as a contact"); }