MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / getContact

Method getContact

src/main/java/Client/Roster.java:727–760  ·  view source on GitHub ↗
(final String jid, boolean createInNIL)

Source from the content-addressed store, hash-verified

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();

Callers 11

blockArrivedMethod · 0.95
blockArrivedMethod · 0.95
blockArrivedMethod · 0.95
blockArrivedMethod · 0.95
selfContactMethod · 0.95
addFileQueryMethod · 0.95
blockArrivedMethod · 0.45
blockArrivedMethod · 0.45
blockArrivedMethod · 0.45
cmdOkMethod · 0.45

Calls 6

findContactMethod · 0.95
addContactMethod · 0.95
setStatusMethod · 0.95
cloneMethod · 0.95
sortMethod · 0.80
getGroupMethod · 0.45

Tested by

no test coverage detected