aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-02-23 13:12:48 +0100
committersteckbrief <steckbrief@chefmail.de>2016-02-23 13:12:48 +0100
commit1c983b3b0f92c547ab4b3ed0248b198d8e4dcd78 (patch)
tree8c4258fed1b5676146e07d5189893ea94dbad6b0 /src
parentcbec38f02df862ded4e89cdff7e0cdc53bdf083b (diff)
Changed access to presences according to new Presence representation in C
Diffstat (limited to '')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java6
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java10
-rw-r--r--src/main/java/eu/siacs/conversations/utils/UIHelper.java13
3 files changed, 15 insertions, 14 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java
index 424c2a12..e14d7f6b 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java
@@ -44,10 +44,10 @@ public class PresencesArrayAdapter extends ArrayAdapter<Presence> {
private static Presence[] getPresenceArray(Presences presences) {
ArrayList<Presence> presenceArrayList = new ArrayList<>();
if (null != presences && null != presences.getPresences() && !presences.getPresences().isEmpty()) {
- for (Map.Entry<String, Integer> entry : presences.getPresences().entrySet()) {
+ for (Map.Entry<String, eu.siacs.conversations.entities.Presence> entry : presences.getPresences().entrySet()) {
Presence p = new Presence();
p.resource = entry.getKey();
- p.status = entry.getValue();
+ p.status = entry.getValue().getStatus();
presenceArrayList.add(p);
}
presenceArrayList.trimToSize();
@@ -58,5 +58,5 @@ public class PresencesArrayAdapter extends ArrayAdapter<Presence> {
class Presence {
String resource;
- int status;
+ eu.siacs.conversations.entities.Presence.Status status;
}
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index 9c3b5430..2e40717a 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -74,15 +74,15 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
String color = "#000000";
if (conversation.getMode() == Conversation.MODE_SINGLE) {
switch (conversation.getContact().getMostAvailableStatus()) {
- case Presences.ONLINE:
- case Presences.CHAT:
+ case ONLINE:
+ case CHAT:
color = "#259B23";
break;
- case Presences.AWAY:
- case Presences.XA:
+ case AWAY:
+ case XA:
color = "#FF9800";
break;
- case Presences.DND:
+ case DND:
color = "#E51C23";
break;
}
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
index ae5d97d9..bc64dd5e 100644
--- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
@@ -16,6 +16,7 @@ import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.Message;
+import eu.siacs.conversations.entities.Presence;
import eu.siacs.conversations.entities.Presences;
import eu.siacs.conversations.entities.Transferable;
import eu.siacs.conversations.xmpp.jid.Jid;
@@ -243,15 +244,15 @@ public class UIHelper {
}
}
- public static String getStatusColor(int status) {
+ public static String getStatusColor(Presence.Status status) {
switch (status) {
- case Presences.ONLINE:
- case Presences.CHAT:
+ case ONLINE:
+ case CHAT:
return "#259B23";
- case Presences.AWAY:
- case Presences.XA:
+ case AWAY:
+ case XA:
return "#FF9800";
- case Presences.DND:
+ case DND:
return "#E51C23";
}
return "#CCCCCC";