aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/entities
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-06-06 11:39:17 +0200
committeriNPUTmice <daniel@gultsch.de>2014-06-06 11:39:17 +0200
commit5fe926b64586f5ac7d3eba7a64de81a710437a14 (patch)
tree84f720295ece0ede1e13f53f06bc7aaa9b044786 /src/eu/siacs/conversations/entities
parenta583471af843e1b1682d36efee04caa5767419ea (diff)
basic last seen feature. no peristancy just yet. no polish
Diffstat (limited to 'src/eu/siacs/conversations/entities')
-rw-r--r--src/eu/siacs/conversations/entities/Contact.java8
-rw-r--r--src/eu/siacs/conversations/entities/Message.java9
2 files changed, 16 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/entities/Contact.java b/src/eu/siacs/conversations/entities/Contact.java
index cff0dd73..8f4b6193 100644
--- a/src/eu/siacs/conversations/entities/Contact.java
+++ b/src/eu/siacs/conversations/entities/Contact.java
@@ -11,7 +11,6 @@ import org.json.JSONObject;
import eu.siacs.conversations.xml.Element;
import android.content.ContentValues;
import android.database.Cursor;
-import android.util.Log;
public class Contact {
public static final String TABLENAME = "contacts";
@@ -38,6 +37,8 @@ public class Contact {
protected Account account;
protected boolean inRoster = true;
+
+ public Lastseen lastseen = new Lastseen();
public Contact(String account, String systemName, String serverName,
String jid, int subscription, String photoUri,
@@ -305,4 +306,9 @@ public class Contact {
public static final int DIRTY_PUSH = 6;
public static final int DIRTY_DELETE = 7;
}
+
+ public class Lastseen {
+ public long time = 0;
+ public String presence = null;
+ }
}
diff --git a/src/eu/siacs/conversations/entities/Message.java b/src/eu/siacs/conversations/entities/Message.java
index cc6bc7c2..c298a652 100644
--- a/src/eu/siacs/conversations/entities/Message.java
+++ b/src/eu/siacs/conversations/entities/Message.java
@@ -203,6 +203,15 @@ public class Message extends AbstractEntity {
this.counterpart = this.counterpart.split("/")[0] + "/" + presence;
}
+ public String getPresence() {
+ String[] counterparts = this.counterpart.split("/");
+ if (counterparts.length == 2) {
+ return counterparts[1];
+ } else {
+ return null;
+ }
+ }
+
public void setJingleConnection(JingleConnection connection) {
this.jingleConnection = connection;
}