(final String jid, boolean createInNIL)
| 725 | //#endif |
| 726 | |
| 727 | public final Contact getContact(final String jid, boolean createInNIL) { |
| 728 | Jid J = new Jid(jid); |
| 729 | |
| 730 | Contact c = findContact(J, true); |
| 731 | if (c != null) { |
| 732 | return c; |
| 733 | } |
| 734 | |
| 735 | c = findContact(J, false); |
| 736 | if (c == null) { |
| 737 | if (!createInNIL) { |
| 738 | return null; |
| 739 | } |
| 740 | c = new Contact(null, jid, Presence.PRESENCE_OFFLINE, "none"); /* |
| 741 | * "not-in-list" |
| 742 | */ |
| 743 | c.origin = Contact.ORIGIN_PRESENCE; |
| 744 | c.group = groups.getGroup(Groups.TYPE_NOT_IN_LIST); |
| 745 | addContact(c); |
| 746 | } else { |
| 747 | if (c.origin == Contact.ORIGIN_ROSTER) { |
| 748 | c.origin = Contact.ORIGIN_ROSTERRES; |
| 749 | c.setStatus(Presence.PRESENCE_OFFLINE); |
| 750 | c.jid = J; |
| 751 | //System.out.println("add resource"); |
| 752 | } else { |
| 753 | c = c.clone(J, Presence.PRESENCE_OFFLINE); |
| 754 | addContact(c); |
| 755 | //System.out.println("cloned"); |
| 756 | } |
| 757 | } |
| 758 | sort(hContacts); |
| 759 | return c; |
| 760 | } |
| 761 | |
| 762 | public void showContactMessageList(String jid) { |
| 763 | sd.roster.getContact(jid, false).getMsgList(); |
no test coverage detected