2015-01-15 21:35:35 +00:00
|
|
|
/**
|
|
|
|
* Copyright (C) 2015 Open Whisper Systems
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.database.Cursor;
|
2015-11-05 16:47:29 +00:00
|
|
|
import android.graphics.drawable.ColorDrawable;
|
2015-01-15 21:35:35 +00:00
|
|
|
import android.os.AsyncTask;
|
2015-11-05 16:47:29 +00:00
|
|
|
import android.os.Build;
|
2015-01-15 21:35:35 +00:00
|
|
|
import android.os.Bundle;
|
2014-12-15 20:25:55 +00:00
|
|
|
import android.support.annotation.NonNull;
|
2016-08-16 03:23:56 +00:00
|
|
|
import android.support.annotation.Nullable;
|
2015-01-15 21:35:35 +00:00
|
|
|
import android.support.v4.app.LoaderManager.LoaderCallbacks;
|
|
|
|
import android.support.v4.content.Loader;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.view.LayoutInflater;
|
2015-03-05 00:37:48 +00:00
|
|
|
import android.view.MenuItem;
|
2015-01-15 21:35:35 +00:00
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
import android.widget.ListView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
2015-11-05 16:47:29 +00:00
|
|
|
import org.thoughtcrime.securesms.color.MaterialColor;
|
2015-01-15 21:35:35 +00:00
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
2017-07-26 16:59:15 +00:00
|
|
|
import org.thoughtcrime.securesms.database.Address;
|
2015-01-15 21:35:35 +00:00
|
|
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
|
|
|
import org.thoughtcrime.securesms.database.EncryptingSmsDatabase;
|
|
|
|
import org.thoughtcrime.securesms.database.MmsDatabase;
|
|
|
|
import org.thoughtcrime.securesms.database.MmsSmsDatabase;
|
|
|
|
import org.thoughtcrime.securesms.database.SmsDatabase;
|
|
|
|
import org.thoughtcrime.securesms.database.loaders.MessageDetailsLoader;
|
|
|
|
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
2015-08-15 12:00:08 +00:00
|
|
|
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
2015-01-15 21:35:35 +00:00
|
|
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
2015-06-09 14:37:20 +00:00
|
|
|
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
2015-01-15 21:35:35 +00:00
|
|
|
import org.thoughtcrime.securesms.recipients.Recipients;
|
|
|
|
import org.thoughtcrime.securesms.util.DateUtils;
|
2015-03-10 19:40:55 +00:00
|
|
|
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
|
|
|
import org.thoughtcrime.securesms.util.DynamicTheme;
|
2016-08-16 03:23:56 +00:00
|
|
|
import org.thoughtcrime.securesms.util.ExpirationUtil;
|
2015-01-15 21:35:35 +00:00
|
|
|
import org.thoughtcrime.securesms.util.GroupUtil;
|
2015-11-05 16:47:29 +00:00
|
|
|
import org.thoughtcrime.securesms.util.Util;
|
2015-01-15 21:35:35 +00:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.lang.ref.WeakReference;
|
|
|
|
import java.sql.Date;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.LinkedList;
|
2015-03-19 20:08:48 +00:00
|
|
|
import java.util.Locale;
|
2015-01-15 21:35:35 +00:00
|
|
|
|
2015-03-08 18:37:18 +00:00
|
|
|
/**
|
|
|
|
* @author Jake McGinty
|
|
|
|
*/
|
2015-11-05 16:47:29 +00:00
|
|
|
public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity implements LoaderCallbacks<Cursor>, Recipients.RecipientsModifiedListener {
|
2015-01-15 21:35:35 +00:00
|
|
|
private final static String TAG = MessageDetailsActivity.class.getSimpleName();
|
|
|
|
|
2015-11-05 16:47:29 +00:00
|
|
|
public final static String MASTER_SECRET_EXTRA = "master_secret";
|
|
|
|
public final static String MESSAGE_ID_EXTRA = "message_id";
|
2015-08-15 12:00:08 +00:00
|
|
|
public final static String THREAD_ID_EXTRA = "thread_id";
|
2015-11-05 16:47:29 +00:00
|
|
|
public final static String IS_PUSH_GROUP_EXTRA = "is_push_group";
|
|
|
|
public final static String TYPE_EXTRA = "type";
|
2017-07-26 16:59:15 +00:00
|
|
|
public final static String ADDRESSES_EXTRA = "addresses";
|
2015-01-15 21:35:35 +00:00
|
|
|
|
|
|
|
private MasterSecret masterSecret;
|
2015-08-15 12:00:08 +00:00
|
|
|
private long threadId;
|
2015-02-27 02:31:22 +00:00
|
|
|
private boolean isPushGroup;
|
2015-01-15 21:35:35 +00:00
|
|
|
private ConversationItem conversationItem;
|
|
|
|
private ViewGroup itemParent;
|
2015-02-27 19:07:20 +00:00
|
|
|
private View metadataContainer;
|
2016-08-16 03:23:56 +00:00
|
|
|
private View expiresContainer;
|
2015-02-27 19:07:20 +00:00
|
|
|
private TextView errorText;
|
2015-01-15 21:35:35 +00:00
|
|
|
private TextView sentDate;
|
|
|
|
private TextView receivedDate;
|
2016-08-16 03:23:56 +00:00
|
|
|
private TextView expiresInText;
|
2015-01-15 21:35:35 +00:00
|
|
|
private View receivedContainer;
|
|
|
|
private TextView transport;
|
|
|
|
private TextView toFrom;
|
|
|
|
private ListView recipientsList;
|
|
|
|
private LayoutInflater inflater;
|
|
|
|
|
2015-03-10 19:40:55 +00:00
|
|
|
private DynamicTheme dynamicTheme = new DynamicTheme();
|
|
|
|
private DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
|
|
|
|
2016-08-16 03:23:56 +00:00
|
|
|
private boolean running;
|
|
|
|
|
2015-01-15 21:35:35 +00:00
|
|
|
@Override
|
2014-12-15 20:25:55 +00:00
|
|
|
protected void onPreCreate() {
|
2015-03-10 19:40:55 +00:00
|
|
|
dynamicTheme.onCreate(this);
|
|
|
|
dynamicLanguage.onCreate(this);
|
2014-12-15 20:25:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onCreate(Bundle bundle, @NonNull MasterSecret masterSecret) {
|
2015-01-15 21:35:35 +00:00
|
|
|
setContentView(R.layout.message_details_activity);
|
2016-08-16 03:23:56 +00:00
|
|
|
running = true;
|
2015-01-15 21:35:35 +00:00
|
|
|
|
|
|
|
initializeResources();
|
2015-11-05 16:47:29 +00:00
|
|
|
initializeActionBar();
|
2015-01-15 21:35:35 +00:00
|
|
|
getSupportLoaderManager().initLoader(0, null, this);
|
|
|
|
}
|
|
|
|
|
2015-03-10 19:40:55 +00:00
|
|
|
@Override
|
|
|
|
protected void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
dynamicTheme.onResume(this);
|
|
|
|
dynamicLanguage.onResume(this);
|
2015-04-23 21:25:49 +00:00
|
|
|
getSupportActionBar().setTitle(R.string.AndroidManifest__message_details);
|
2015-08-15 12:00:08 +00:00
|
|
|
|
|
|
|
MessageNotifier.setVisibleThread(threadId);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onPause() {
|
|
|
|
super.onPause();
|
|
|
|
MessageNotifier.setVisibleThread(-1L);
|
2015-03-10 19:40:55 +00:00
|
|
|
}
|
|
|
|
|
2016-08-16 03:23:56 +00:00
|
|
|
@Override
|
|
|
|
protected void onDestroy() {
|
|
|
|
super.onDestroy();
|
|
|
|
running = false;
|
|
|
|
}
|
|
|
|
|
2015-11-05 16:47:29 +00:00
|
|
|
private void initializeActionBar() {
|
|
|
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
|
|
|
2017-07-26 16:59:15 +00:00
|
|
|
Recipients recipients = RecipientFactory.getRecipientsFor(this, Address.fromParcelable(getIntent().getParcelableArrayExtra(ADDRESSES_EXTRA)), true);
|
2015-11-05 16:47:29 +00:00
|
|
|
recipients.addListener(this);
|
|
|
|
|
|
|
|
setActionBarColor(recipients.getColor());
|
|
|
|
}
|
|
|
|
|
|
|
|
private void setActionBarColor(MaterialColor color) {
|
|
|
|
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color.toActionBarColor(this)));
|
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
|
getWindow().setStatusBarColor(color.toStatusBarColor(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onModified(final Recipients recipients) {
|
|
|
|
Util.runOnMain(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
setActionBarColor(recipients.getColor());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2015-01-15 21:35:35 +00:00
|
|
|
private void initializeResources() {
|
|
|
|
inflater = LayoutInflater.from(this);
|
|
|
|
View header = inflater.inflate(R.layout.message_details_header, recipientsList, false);
|
|
|
|
|
|
|
|
masterSecret = getIntent().getParcelableExtra(MASTER_SECRET_EXTRA);
|
2015-08-15 12:00:08 +00:00
|
|
|
threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1);
|
2015-02-27 02:31:22 +00:00
|
|
|
isPushGroup = getIntent().getBooleanExtra(IS_PUSH_GROUP_EXTRA, false);
|
2015-03-24 20:37:57 +00:00
|
|
|
itemParent = (ViewGroup) header.findViewById(R.id.item_container);
|
2015-01-15 21:35:35 +00:00
|
|
|
recipientsList = (ListView ) findViewById(R.id.recipients_list);
|
2015-02-27 19:07:20 +00:00
|
|
|
metadataContainer = header.findViewById(R.id.metadata_container);
|
|
|
|
errorText = (TextView ) header.findViewById(R.id.error_text);
|
2015-01-15 21:35:35 +00:00
|
|
|
sentDate = (TextView ) header.findViewById(R.id.sent_time);
|
|
|
|
receivedContainer = header.findViewById(R.id.received_container);
|
|
|
|
receivedDate = (TextView ) header.findViewById(R.id.received_time);
|
|
|
|
transport = (TextView ) header.findViewById(R.id.transport);
|
|
|
|
toFrom = (TextView ) header.findViewById(R.id.tofrom);
|
2016-08-16 03:23:56 +00:00
|
|
|
expiresContainer = header.findViewById(R.id.expires_container);
|
|
|
|
expiresInText = (TextView) header.findViewById(R.id.expires_in);
|
2015-01-15 21:35:35 +00:00
|
|
|
recipientsList.setHeaderDividersEnabled(false);
|
|
|
|
recipientsList.addHeaderView(header, null, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void updateTransport(MessageRecord messageRecord) {
|
|
|
|
final String transportText;
|
|
|
|
if (messageRecord.isOutgoing() && messageRecord.isFailed()) {
|
|
|
|
transportText = "-";
|
|
|
|
} else if (messageRecord.isPending()) {
|
|
|
|
transportText = getString(R.string.ConversationFragment_pending);
|
|
|
|
} else if (messageRecord.isPush()) {
|
|
|
|
transportText = getString(R.string.ConversationFragment_push);
|
|
|
|
} else if (messageRecord.isMms()) {
|
|
|
|
transportText = getString(R.string.ConversationFragment_mms);
|
|
|
|
} else {
|
|
|
|
transportText = getString(R.string.ConversationFragment_sms);
|
|
|
|
}
|
|
|
|
|
|
|
|
transport.setText(transportText);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void updateTime(MessageRecord messageRecord) {
|
|
|
|
if (messageRecord.isPending() || messageRecord.isFailed()) {
|
|
|
|
sentDate.setText("-");
|
|
|
|
receivedContainer.setVisibility(View.GONE);
|
|
|
|
} else {
|
2015-03-19 20:08:48 +00:00
|
|
|
Locale dateLocale = dynamicLanguage.getCurrentLocale();
|
|
|
|
SimpleDateFormat dateFormatter = DateUtils.getDetailedDateFormatter(this, dateLocale);
|
2015-01-15 21:35:35 +00:00
|
|
|
sentDate.setText(dateFormatter.format(new Date(messageRecord.getDateSent())));
|
|
|
|
|
|
|
|
if (messageRecord.getDateReceived() != messageRecord.getDateSent() && !messageRecord.isOutgoing()) {
|
|
|
|
receivedDate.setText(dateFormatter.format(new Date(messageRecord.getDateReceived())));
|
|
|
|
receivedContainer.setVisibility(View.VISIBLE);
|
|
|
|
} else {
|
|
|
|
receivedContainer.setVisibility(View.GONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-16 03:23:56 +00:00
|
|
|
private void updateExpirationTime(final MessageRecord messageRecord) {
|
|
|
|
if (messageRecord.getExpiresIn() <= 0 || messageRecord.getExpireStarted() <= 0) {
|
|
|
|
expiresContainer.setVisibility(View.GONE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
expiresContainer.setVisibility(View.VISIBLE);
|
|
|
|
expiresInText.post(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
long elapsed = System.currentTimeMillis() - messageRecord.getExpireStarted();
|
|
|
|
long remaining = messageRecord.getExpiresIn() - elapsed;
|
|
|
|
|
|
|
|
String duration = ExpirationUtil.getExpirationDisplayValue(MessageDetailsActivity.this, Math.max((int)(remaining / 1000), 1));
|
|
|
|
expiresInText.setText(duration);
|
|
|
|
|
|
|
|
if (running) {
|
|
|
|
expiresInText.postDelayed(this, 500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2015-01-15 21:35:35 +00:00
|
|
|
private void updateRecipients(MessageRecord messageRecord, Recipients recipients) {
|
|
|
|
final int toFromRes;
|
|
|
|
if (messageRecord.isMms() && !messageRecord.isPush() && !messageRecord.isOutgoing()) {
|
|
|
|
toFromRes = R.string.message_details_header__with;
|
|
|
|
} else if (messageRecord.isOutgoing()) {
|
|
|
|
toFromRes = R.string.message_details_header__to;
|
|
|
|
} else {
|
|
|
|
toFromRes = R.string.message_details_header__from;
|
|
|
|
}
|
|
|
|
toFrom.setText(toFromRes);
|
2015-09-15 22:28:27 +00:00
|
|
|
conversationItem.bind(masterSecret, messageRecord, dynamicLanguage.getCurrentLocale(),
|
2015-10-21 22:32:29 +00:00
|
|
|
new HashSet<MessageRecord>(), recipients);
|
2015-02-27 02:31:22 +00:00
|
|
|
recipientsList.setAdapter(new MessageDetailsRecipientAdapter(this, masterSecret, messageRecord,
|
|
|
|
recipients, isPushGroup));
|
2015-01-15 21:35:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void inflateMessageViewIfAbsent(MessageRecord messageRecord) {
|
|
|
|
if (conversationItem == null) {
|
|
|
|
if (messageRecord.isGroupAction()) {
|
2015-09-17 00:31:24 +00:00
|
|
|
conversationItem = (ConversationItem) inflater.inflate(R.layout.conversation_item_update, itemParent, false);
|
2015-01-15 21:35:35 +00:00
|
|
|
} else if (messageRecord.isOutgoing()) {
|
|
|
|
conversationItem = (ConversationItem) inflater.inflate(R.layout.conversation_item_sent, itemParent, false);
|
|
|
|
} else {
|
|
|
|
conversationItem = (ConversationItem) inflater.inflate(R.layout.conversation_item_received, itemParent, false);
|
|
|
|
}
|
|
|
|
itemParent.addView(conversationItem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-16 03:23:56 +00:00
|
|
|
private @Nullable MessageRecord getMessageRecord(Context context, Cursor cursor, String type) {
|
2015-01-15 21:35:35 +00:00
|
|
|
switch (type) {
|
|
|
|
case MmsSmsDatabase.SMS_TRANSPORT:
|
|
|
|
EncryptingSmsDatabase smsDatabase = DatabaseFactory.getEncryptingSmsDatabase(context);
|
|
|
|
SmsDatabase.Reader reader = smsDatabase.readerFor(masterSecret, cursor);
|
|
|
|
return reader.getNext();
|
|
|
|
case MmsSmsDatabase.MMS_TRANSPORT:
|
|
|
|
MmsDatabase mmsDatabase = DatabaseFactory.getMmsDatabase(context);
|
|
|
|
MmsDatabase.Reader mmsReader = mmsDatabase.readerFor(masterSecret, cursor);
|
|
|
|
return mmsReader.getNext();
|
|
|
|
default:
|
|
|
|
throw new AssertionError("no valid message type specified");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
|
|
|
return new MessageDetailsLoader(this, getIntent().getStringExtra(TYPE_EXTRA),
|
|
|
|
getIntent().getLongExtra(MESSAGE_ID_EXTRA, -1));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
|
2016-08-16 03:23:56 +00:00
|
|
|
MessageRecord messageRecord = getMessageRecord(this, cursor, getIntent().getStringExtra(TYPE_EXTRA));
|
|
|
|
|
|
|
|
if (messageRecord == null) {
|
|
|
|
finish();
|
|
|
|
} else {
|
|
|
|
new MessageRecipientAsyncTask(this, messageRecord).execute();
|
|
|
|
}
|
2015-01-15 21:35:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onLoaderReset(Loader<Cursor> loader) {
|
|
|
|
recipientsList.setAdapter(null);
|
|
|
|
}
|
|
|
|
|
2015-03-05 00:37:48 +00:00
|
|
|
@Override
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
|
super.onOptionsItemSelected(item);
|
|
|
|
|
|
|
|
switch (item.getItemId()) {
|
|
|
|
case android.R.id.home: finish(); return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-01-15 21:35:35 +00:00
|
|
|
private class MessageRecipientAsyncTask extends AsyncTask<Void,Void,Recipients> {
|
|
|
|
private WeakReference<Context> weakContext;
|
|
|
|
private MessageRecord messageRecord;
|
|
|
|
|
2016-08-16 03:23:56 +00:00
|
|
|
public MessageRecipientAsyncTask(@NonNull Context context, @NonNull MessageRecord messageRecord) {
|
2015-01-15 21:35:35 +00:00
|
|
|
this.weakContext = new WeakReference<>(context);
|
|
|
|
this.messageRecord = messageRecord;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected Context getContext() {
|
|
|
|
return weakContext.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Recipients doInBackground(Void... voids) {
|
|
|
|
Context context = getContext();
|
|
|
|
if (context == null) {
|
|
|
|
Log.w(TAG, "associated context is destroyed, finishing early");
|
2015-07-09 20:02:12 +00:00
|
|
|
return null;
|
2015-01-15 21:35:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Recipients recipients;
|
|
|
|
|
|
|
|
final Recipients intermediaryRecipients;
|
|
|
|
if (messageRecord.isMms()) {
|
|
|
|
intermediaryRecipients = DatabaseFactory.getMmsAddressDatabase(context).getRecipientsForId(messageRecord.getId());
|
|
|
|
} else {
|
|
|
|
intermediaryRecipients = messageRecord.getRecipients();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!intermediaryRecipients.isGroupRecipient()) {
|
|
|
|
Log.w(TAG, "Recipient is not a group, resolving members immediately.");
|
|
|
|
recipients = intermediaryRecipients;
|
|
|
|
} else {
|
|
|
|
try {
|
2017-07-26 16:59:15 +00:00
|
|
|
Address groupId = intermediaryRecipients.getPrimaryRecipient().getAddress();
|
2015-01-15 21:35:35 +00:00
|
|
|
recipients = DatabaseFactory.getGroupDatabase(context)
|
2017-07-26 16:59:15 +00:00
|
|
|
.getGroupMembers(GroupUtil.getDecodedId(groupId.toGroupString()), false);
|
2015-01-15 21:35:35 +00:00
|
|
|
} catch (IOException e) {
|
|
|
|
Log.w(TAG, e);
|
2015-11-05 16:47:29 +00:00
|
|
|
recipients = RecipientFactory.getRecipientsFor(MessageDetailsActivity.this, new LinkedList<Recipient>(), false);
|
2015-01-15 21:35:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return recipients;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onPostExecute(Recipients recipients) {
|
|
|
|
if (getContext() == null) {
|
|
|
|
Log.w(TAG, "AsyncTask finished with a destroyed context, leaving early.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
inflateMessageViewIfAbsent(messageRecord);
|
|
|
|
|
|
|
|
updateRecipients(messageRecord, recipients);
|
2015-02-27 19:07:20 +00:00
|
|
|
if (messageRecord.isFailed()) {
|
|
|
|
errorText.setVisibility(View.VISIBLE);
|
|
|
|
metadataContainer.setVisibility(View.GONE);
|
|
|
|
} else {
|
|
|
|
updateTransport(messageRecord);
|
|
|
|
updateTime(messageRecord);
|
2016-08-16 03:23:56 +00:00
|
|
|
updateExpirationTime(messageRecord);
|
2015-02-27 19:07:20 +00:00
|
|
|
errorText.setVisibility(View.GONE);
|
|
|
|
metadataContainer.setVisibility(View.VISIBLE);
|
|
|
|
}
|
2015-01-15 21:35:35 +00:00
|
|
|
}
|
2015-03-08 18:37:18 +00:00
|
|
|
}
|
2015-01-15 21:35:35 +00:00
|
|
|
}
|