mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
display last-seen information if address will not be shown
This commit is contained in:
@@ -19,8 +19,12 @@ import org.thoughtcrime.securesms.components.AvatarView;
|
||||
import org.thoughtcrime.securesms.connect.DcHelper;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.DateUtils;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class ConversationTitleView extends RelativeLayout {
|
||||
|
||||
private View content;
|
||||
@@ -105,6 +109,12 @@ public class ConversationTitleView extends RelativeLayout {
|
||||
DcContact dcContact = dcContext.getContact(chatContacts[0]);
|
||||
if (profileView || !dcChat.isProtected()) {
|
||||
subtitleStr = dcContact.getAddr();
|
||||
} else {
|
||||
long timestamp = dcContact.getLastSeen();
|
||||
if (timestamp != 0) {
|
||||
Locale locale = DynamicLanguage.getSelectedLocale(context);
|
||||
subtitleStr = context.getString(R.string.last_seen_at, DateUtils.getExtendedTimeSpanString(context, locale, timestamp));
|
||||
}
|
||||
}
|
||||
isOnline = dcContact.wasSeenRecently();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user