void login() { try { logoutBtn.setEnabled(true); contactList.setEditable(false); loginBtn.setEnabled(false); loginId.setEnabled(false); password.setEnabled(false); // plugin.login( getMyLoginId(), password.getText(), getContactList(), MessagingNetwork.STATUS_ONLINE); logoutBtn.setEnabled(true); } catch (Throwable tr) { printException(tr); boolean loggedIn = false; try { loggedIn = plugin.getClientStatus(getMyLoginId()) != MessagingNetwork.STATUS_OFFLINE; } catch (Throwable tr2) { printException(tr2); } if (!loggedIn) { enableLoginUI(); } } }
void fetchUserDetails() { try { UserDetails d = plugin.getUserDetails(getMyLoginId(), contactListEntry.getText()); String s = getMyLoginId() + " reports: user details for " + contactListEntry.getText() + " are:\r\n nick=" + StringUtil.toPrintableString(d.getNick()) + ",\r\n real name=" + StringUtil.toPrintableString(d.getRealName()) + ",\r\n email=" + StringUtil.toPrintableString(d.getEmail()) + "."; CAT.info(s); log(s); } catch (Exception ex) { printException(ex); } }
void sendContacts() { try { int n = (int) (7 * Math.random()); if (n < 1) n = 2; String[] nicks = new String[n]; String[] loginIds = new String[n]; int i = 0; while (i < n) { nicks[i] = "random uin #" + i; loginIds[i] = "" + (22222 + (int) (10000000 * Math.random())); i++; } plugin.sendContacts(getMyLoginId(), contactListEntry.getText(), nicks, loginIds); } catch (Exception ex) { printException(ex); } }
String getMyLoginId() { return loginId.getText(); }