diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-05 22:33:39 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-05 22:33:39 +0100 |
commit | aa42eb544a1ebf99dc52d71c917b899d1fce628d (patch) | |
tree | bb5523f3342823faf7dce746d298f2650936d03a /src/de/gultsch/chat/entities | |
parent | 4670585e7a474d878c823df6de1846980b5c65d3 (diff) |
basic muc support. reworked contact list stuff
Diffstat (limited to 'src/de/gultsch/chat/entities')
-rw-r--r-- | src/de/gultsch/chat/entities/Contact.java | 24 | ||||
-rw-r--r-- | src/de/gultsch/chat/entities/Conversation.java | 20 |
2 files changed, 40 insertions, 4 deletions
diff --git a/src/de/gultsch/chat/entities/Contact.java b/src/de/gultsch/chat/entities/Contact.java index f235fb4d..47549b22 100644 --- a/src/de/gultsch/chat/entities/Contact.java +++ b/src/de/gultsch/chat/entities/Contact.java @@ -28,6 +28,9 @@ public class Contact extends AbstractEntity implements Serializable { protected String photoUri; protected String openPGPKey; protected long lastOnlinePresence; + + + protected Account account; public Contact(Account account, String displayName, String jid, String photoUri) { if (account == null) { @@ -95,4 +98,25 @@ public class Contact extends AbstractEntity implements Serializable { cursor.getLong(cursor.getColumnIndex(LASTONLINEPRESENCE)) ); } + + public void setSubscription(String subscription) { + this.subscription = subscription; + } + + public void setSystemAccount(int account) { + this.systemAccount = account; + } + + public void setAccount(Account account) { + this.account = account; + this.accountUuid = account.getUuid(); + } + + public Account getAccount() { + return this.account; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } } diff --git a/src/de/gultsch/chat/entities/Conversation.java b/src/de/gultsch/chat/entities/Conversation.java index ca359477..1b666ce3 100644 --- a/src/de/gultsch/chat/entities/Conversation.java +++ b/src/de/gultsch/chat/entities/Conversation.java @@ -16,6 +16,9 @@ public class Conversation extends AbstractEntity { public static final int STATUS_AVAILABLE = 0; public static final int STATUS_ARCHIVED = 1; public static final int STATUS_DELETED = 2; + + public static final int MODE_MULTI = 1; + public static final int MODE_SINGLE = 0; public static final String NAME = "name"; public static final String PHOTO_URI = "profilePhotoUri"; @@ -23,6 +26,7 @@ public class Conversation extends AbstractEntity { public static final String CONTACT = "contactJid"; public static final String STATUS = "status"; public static final String CREATED = "created"; + public static final String MODE = "mode"; private String name; private String profilePhotoUri; @@ -30,19 +34,20 @@ public class Conversation extends AbstractEntity { private String contactJid; private int status; private long created; + private int mode; private transient List<Message> messages = null; private transient Account account = null; public Conversation(String name, String profilePhoto, Account account, - String contactJid) { + String contactJid, int mode) { this(java.util.UUID.randomUUID().toString(), name, profilePhoto, account.getUuid(), contactJid, System - .currentTimeMillis(), STATUS_AVAILABLE); + .currentTimeMillis(), STATUS_AVAILABLE,mode); this.account = account; } public Conversation(String uuid, String name, String profilePhoto, - String accountUuid, String contactJid, long created, int status) { + String accountUuid, String contactJid, long created, int status, int mode) { this.uuid = uuid; this.name = name; this.profilePhotoUri = profilePhoto; @@ -50,6 +55,7 @@ public class Conversation extends AbstractEntity { this.contactJid = contactJid; this.created = created; this.status = status; + this.mode = mode; } public List<Message> getMessages() { @@ -132,6 +138,7 @@ public class Conversation extends AbstractEntity { values.put(CONTACT, contactJid); values.put(CREATED, created); values.put(STATUS, status); + values.put(MODE,mode); return values; } @@ -142,10 +149,15 @@ public class Conversation extends AbstractEntity { cursor.getString(cursor.getColumnIndex(ACCOUNT)), cursor.getString(cursor.getColumnIndex(CONTACT)), cursor.getLong(cursor.getColumnIndex(CREATED)), - cursor.getInt(cursor.getColumnIndex(STATUS))); + cursor.getInt(cursor.getColumnIndex(STATUS)), + cursor.getInt(cursor.getColumnIndex(MODE))); } public void setStatus(int status) { this.status = status; } + + public int getMode() { + return this.mode; + } } |