From e38dc86f8da91a76e00a5a18c6ba366ac812fd69 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Mon, 4 Sep 2006 22:05:00 +0000 Subject: [PATCH] Refactoring work. Method #getLastActivity(XMPPConnection,String) was deprecated. SMACK-94 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@5222 b35dd754-fafc-0310-a699-88a17e54d16e --- .../smackx/packet/LastActivity.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/source/org/jivesoftware/smackx/packet/LastActivity.java b/source/org/jivesoftware/smackx/packet/LastActivity.java index d3005377e..adac0b182 100644 --- a/source/org/jivesoftware/smackx/packet/LastActivity.java +++ b/source/org/jivesoftware/smackx/packet/LastActivity.java @@ -18,7 +18,6 @@ * limitations under the License. */ - package org.jivesoftware.smackx.packet; import org.jivesoftware.smack.PacketCollector; @@ -34,21 +33,14 @@ import org.xmlpull.v1.XmlPullParser; /** * A last activity IQ for retrieving information about the last activity associated with a Jabber ID. * LastActivity (JEP-012) allows for retrieval of how long a particular user has been idle and the - * message the specified when doing so. - * To get the last activity of a user, simple send the LastActivity packet to them, as in the - * following code example: - *

- *

- * XMPPConnection con = new XMPPConnection("jabber.org");
- * con.login("john", "doe");
- * LastActivity activity = LastActivity.getLastActivity(con, "xray@jabber.org");
- * 
+ * message the specified when doing so. Use {@link org.jivesoftware.smackx.LastActivityManager} + * to get the last activity of a user. * * @author Derek DeMoro */ public class LastActivity extends IQ { - public long lastActivity; + public long lastActivity = -1; public String message; public LastActivity() { @@ -57,12 +49,17 @@ public class LastActivity extends IQ { public String getChildElementXML() { StringBuilder buf = new StringBuilder(); - buf.append(""); + buf.append(""); return buf.toString(); } - private void setLastActivity(long lastActivity) { + public void setLastActivity(long lastActivity) { this.lastActivity = lastActivity; } @@ -134,6 +131,8 @@ public class LastActivity extends IQ { * @param jid the JID of the user. * @return the LastActivity packet of the jid. * @throws XMPPException thrown if a server error has occured. + * @deprecated This method only retreives the lapsed time since the last logout of a particular jid. + * Replaced by {@link org.jivesoftware.smackx.LastActivityManager#getLastActivity(XMPPConnection, String) getLastActivity} */ public static LastActivity getLastActivity(XMPPConnection con, String jid) throws XMPPException { LastActivity activity = new LastActivity();