diff options
Diffstat (limited to 'src/eu/siacs/conversations/entities')
-rw-r--r-- | src/eu/siacs/conversations/entities/Contact.java | 8 | ||||
-rw-r--r-- | src/eu/siacs/conversations/entities/Message.java | 9 |
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; } |