diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-06-06 19:37:34 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-06-06 19:37:34 +0200 |
commit | fc656c5571a1f10ff64134c11aa4017f4f9a70e1 (patch) | |
tree | ecbc2c7f2b916eba19b11fcdeb7f1f3c41ef1c2d /src | |
parent | 246776067a3cf4d996e60551c7e59278b83427f1 (diff) |
removed presence from last seen
Diffstat (limited to 'src')
-rw-r--r-- | src/eu/siacs/conversations/ui/ConversationFragment.java | 8 | ||||
-rw-r--r-- | src/eu/siacs/conversations/utils/UIHelper.java | 13 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index 6ca88008..29033891 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -666,13 +666,7 @@ public class ConversationFragment extends Fragment { } if (activity.showLastseen()) { Contact contact = conversation.getContact(); - if ((contact.lastseen.presence != null)&&(contact.lastseen.time != 0)) { - lastSeenText.setText(getString(R.string.last_seen, - UIHelper.lastseen(getActivity(), contact.lastseen.time), - contact.lastseen.presence)); - } else { - lastSeenText.setText(R.string.never_seen); - } + lastSeenText.setText(UIHelper.lastseen(getActivity(), contact.lastseen.time)); } this.messageList.clear(); this.messageList.addAll(this.conversation.getMessages()); diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java index 00885f7c..3d6f4cea 100644 --- a/src/eu/siacs/conversations/utils/UIHelper.java +++ b/src/eu/siacs/conversations/utils/UIHelper.java @@ -73,15 +73,18 @@ public class UIHelper { } public static String lastseen(Context context, long time) { + if (time==0) { + return context.getString(R.string.never_seen); + } long difference = (System.currentTimeMillis() - time) / 1000; if (difference < 60) { return context.getString(R.string.just_now); - } else if (difference < 60 * 60) { - return difference / 60 + " " + context.getString(R.string.mins); - } else if (difference < 60 * 60 * 24) { - return difference / (60 * 60)+ " " + context.getString(R.string.hours); + } else if (difference < 60 * 90) { + return context.getString(R.string.last_seen_mins,difference/60); + } else if (difference < 60 * 60 * 36) { + return context.getString(R.string.last_seen_hours,difference/(60*60)); } else { - return "days"; + return context.getString(R.string.last_seen_days,difference/(60*60*24)); } } |