diff options
author | steckbrief <steckbrief@chefmail.de> | 2015-04-11 23:00:31 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2015-04-11 23:00:31 +0200 |
commit | deac0df707099ef7ef6bd2420eb1df13a5a83ca1 (patch) | |
tree | 8b087218ad07c5511fe159dbafd5b4be64d23ce1 /src/main/java/eu/siacs/conversations/ui/adapter | |
parent | 17779e77002e99dabb73f4fa8f9596e9d220319b (diff) | |
parent | 82bfd8ac335b84613677ff857cf27c455fdf512d (diff) |
Merge branch 'trz/master' of ssh://git.fucktheforce.de/conversations into trz/master
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java | 31 |
1 files changed, 18 insertions, 13 deletions
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 fac4cc91..86526040 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -23,6 +23,7 @@ import java.util.concurrent.RejectedExecutionException; import de.tzur.conversations.Settings; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; +import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Downloadable; import eu.siacs.conversations.entities.Message; @@ -82,22 +83,26 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { TextView mTimestamp = (TextView) view.findViewById(R.id.conversation_lastupdate); ImageView imagePreview = (ImageView) view.findViewById(R.id.conversation_lastimage); - if (Settings.SHOW_ONLINE_STATUS) { + if (Settings.SHOW_ONLINE_STATUS && conversation != null && conversation.getAccount().getStatus() == Account.State.ONLINE) { TextView status = (TextView) view.findViewById(R.id.status); String color = "#000000"; - switch (conversation.getContact().getMostAvailableStatus()) { - case Presences.ONLINE: - case Presences.CHAT: - color = "#259B23"; - break; - case Presences.AWAY: - case Presences.XA: - color = "#FF9800"; - break; - case Presences.DND: - color = "#E51C23"; - break; + if (conversation.getMode() == Conversation.MODE_SINGLE) { + switch (conversation.getContact().getMostAvailableStatus()) { + case Presences.ONLINE: + case Presences.CHAT: + color = "#259B23"; + break; + case Presences.AWAY: + case Presences.XA: + color = "#FF9800"; + break; + case Presences.DND: + color = "#E51C23"; + break; + } + } else if (conversation.getMode() == Conversation.MODE_MULTI && conversation.getMucOptions().online()) { + color = "#259B23"; } status.setBackgroundColor(Color.parseColor(color)); } |