/** * Constructs a new Presence that is a copy of an existing Presence. * * @param presence the presence packet. * @see #createCopy() */ private Presence(Presence presence) { XElement elementCopy = new XElement(presence.element); new XDocument(docFactory).Add(elementCopy); this.element = elementCopy; // Copy cached JIDs (for performance reasons) this.toJID = presence.toJID; this.fromJID = presence.fromJID; }
/** * Constructs a new Presence with the specified type. * * @param type the presence type. */ public Presence(Presence.Type type) : this() { setType(type); }