mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge branch 'main' into adb/issue-3795
This commit is contained in:
@@ -45,7 +45,6 @@ public class DcChat {
|
||||
public native boolean isDeviceTalk ();
|
||||
public native boolean canSend ();
|
||||
public native boolean isProtected ();
|
||||
public native boolean isProtectionBroken();
|
||||
public native boolean isSendingLocations();
|
||||
public native boolean isMuted ();
|
||||
public native boolean isContactRequest ();
|
||||
@@ -69,10 +68,6 @@ public class DcChat {
|
||||
return getType() == DC_CHAT_TYPE_OUT_BROADCAST;
|
||||
}
|
||||
|
||||
public boolean isHalfBlocked() {
|
||||
return isProtectionBroken() || isContactRequest();
|
||||
}
|
||||
|
||||
// working with raw c-data
|
||||
|
||||
private long chatCPtr; // CAVE: the name is referenced in the JNI
|
||||
|
||||
@@ -12,6 +12,7 @@ public class DcContact {
|
||||
public final static int DC_CONTACT_ID_QR_INVITE = -4; // - " -
|
||||
public final static int DC_CONTACT_ID_NEW_BROADCAST = -5; // - " -
|
||||
public final static int DC_CONTACT_ID_ADD_ACCOUNT = -6; // - " -
|
||||
public final static int DC_CONTACT_ID_NEW_UNENCRYPTED_GROUP = -7; // - " -
|
||||
|
||||
public DcContact(long contactCPtr) {
|
||||
this.contactCPtr = contactCPtr;
|
||||
|
||||
@@ -39,6 +39,7 @@ public class DcContext {
|
||||
|
||||
public final static int DC_GCL_VERIFIED_ONLY = 1;
|
||||
public final static int DC_GCL_ADD_SELF = 2;
|
||||
public final static int DC_GCL_ADDRESS = 0x04;
|
||||
public final static int DC_GCL_ARCHIVED_ONLY = 0x01;
|
||||
public final static int DC_GCL_NO_SPECIALS = 0x02;
|
||||
public final static int DC_GCL_ADD_ALLDONE_HINT = 0x04;
|
||||
|
||||
@@ -33,9 +33,9 @@ public class DcMsg {
|
||||
public final static int DC_INFO_LOCATION_ONLY = 9;
|
||||
public final static int DC_INFO_EPHEMERAL_TIMER_CHANGED = 10;
|
||||
public final static int DC_INFO_PROTECTION_ENABLED = 11;
|
||||
public final static int DC_INFO_PROTECTION_DISABLED = 12;
|
||||
public final static int DC_INFO_INVALID_UNENCRYPTED_MAIL = 13;
|
||||
public final static int DC_INFO_WEBXDC_INFO_MESSAGE = 32;
|
||||
public final static int DC_INFO_CHAT_E2EE = 50;
|
||||
|
||||
public final static int DC_STATE_UNDEFINED = 0;
|
||||
public final static int DC_STATE_IN_FRESH = 10;
|
||||
|
||||
@@ -164,6 +164,10 @@ public class Rpc {
|
||||
return gson.fromJson(getResult("create_broadcast", accountId, chatName), Integer.class);
|
||||
}
|
||||
|
||||
public int createGroupChatUnencrypted(int accountId, String chatName) throws RpcException {
|
||||
return gson.fromJson(getResult("create_group_chat_unencrypted", accountId, chatName), Integer.class);
|
||||
}
|
||||
|
||||
public void setAccountsOrder(List<Integer> order) throws RpcException {
|
||||
getResult("set_accounts_order", order);
|
||||
}
|
||||
|
||||
@@ -197,30 +197,30 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
}
|
||||
}, filter);
|
||||
|
||||
// MAYBE TODO: i think the ApplicationContext is also created
|
||||
// when the app is stated by FetchWorker timeouts.
|
||||
// in this case, the normal threads shall not be started.
|
||||
Constraints constraints = new Constraints.Builder()
|
||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
.build();
|
||||
PeriodicWorkRequest fetchWorkRequest = new PeriodicWorkRequest.Builder(
|
||||
FetchWorker.class,
|
||||
PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS, // usually 15 minutes
|
||||
TimeUnit.MILLISECONDS,
|
||||
PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS, // the start may be preferred by up to 5 minutes, so we run every 10-15 minutes
|
||||
TimeUnit.MILLISECONDS)
|
||||
.setConstraints(constraints)
|
||||
.build();
|
||||
WorkManager.getInstance(this).enqueueUniquePeriodicWork(
|
||||
"FetchWorker",
|
||||
ExistingPeriodicWorkPolicy.KEEP,
|
||||
fetchWorkRequest);
|
||||
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
|
||||
|
||||
if (Prefs.isPushEnabled(this)) {
|
||||
FcmReceiveService.register(this);
|
||||
} else {
|
||||
Log.i(TAG, "FCM disabled at build time");
|
||||
// MAYBE TODO: i think the ApplicationContext is also created
|
||||
// when the app is stated by FetchWorker timeouts.
|
||||
// in this case, the normal threads shall not be started.
|
||||
Constraints constraints = new Constraints.Builder()
|
||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
.build();
|
||||
PeriodicWorkRequest fetchWorkRequest = new PeriodicWorkRequest.Builder(
|
||||
FetchWorker.class,
|
||||
PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS, // usually 15 minutes
|
||||
TimeUnit.MILLISECONDS,
|
||||
PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS, // the start may be preferred by up to 5 minutes, so we run every 10-15 minutes
|
||||
TimeUnit.MILLISECONDS)
|
||||
.setConstraints(constraints)
|
||||
.build();
|
||||
WorkManager.getInstance(this).enqueueUniquePeriodicWork(
|
||||
"FetchWorker",
|
||||
ExistingPeriodicWorkPolicy.KEEP,
|
||||
fetchWorkRequest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public abstract class BaseConversationItem extends LinearLayout
|
||||
protected boolean shouldInterceptClicks(DcMsg messageRecord) {
|
||||
return batchSelected.isEmpty()
|
||||
&& (messageRecord.isFailed()
|
||||
|| messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_DISABLED
|
||||
|| messageRecord.getInfoType() == DcMsg.DC_INFO_CHAT_E2EE
|
||||
|| messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED
|
||||
|| messageRecord.getInfoType() == DcMsg.DC_INFO_INVALID_UNENCRYPTED_MAIL);
|
||||
}
|
||||
@@ -129,9 +129,7 @@ public abstract class BaseConversationItem extends LinearLayout
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.create();
|
||||
d.show();
|
||||
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_DISABLED) {
|
||||
DcHelper.showVerificationBrokenDialog(context, conversationRecipient.getName());
|
||||
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED) {
|
||||
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_CHAT_E2EE || messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED) {
|
||||
DcHelper.showProtectionEnabledDialog(context);
|
||||
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_INVALID_UNENCRYPTED_MAIL) {
|
||||
DcHelper.showInvalidUnencryptedDialog(context);
|
||||
|
||||
@@ -83,6 +83,7 @@ public class ContactSelectionListFragment extends Fragment
|
||||
|
||||
public static final String MULTI_SELECT = "multi_select";
|
||||
public static final String SELECT_VERIFIED_EXTRA = "select_verified";
|
||||
public static final String SELECT_UNENCRYPTED_EXTRA = "select_unencrypted_extra";
|
||||
public static final String ALLOW_CREATION = "allow_creation";
|
||||
public static final String PRESELECTED_CONTACTS = "preselected_contacts";
|
||||
public static final int CONTACT_ADDR_RESULT_CODE = 61123;
|
||||
@@ -251,6 +252,10 @@ public class ContactSelectionListFragment extends Fragment
|
||||
return getActivity().getIntent().getBooleanExtra(SELECT_VERIFIED_EXTRA, false);
|
||||
}
|
||||
|
||||
private boolean isUnencrypted() {
|
||||
return getActivity().getIntent().getBooleanExtra(SELECT_UNENCRYPTED_EXTRA, false);
|
||||
}
|
||||
|
||||
private void initializeCursor() {
|
||||
ContactSelectionListAdapter adapter = new ContactSelectionListAdapter(getActivity(),
|
||||
GlideApp.with(this),
|
||||
@@ -273,11 +278,11 @@ public class ContactSelectionListFragment extends Fragment
|
||||
@Override
|
||||
public Loader<DcContactsLoader.Ret> onCreateLoader(int id, Bundle args) {
|
||||
final boolean allowCreation = getActivity().getIntent().getBooleanExtra(ALLOW_CREATION, true);
|
||||
final boolean addCreateContactLink = allowCreation && !isSelectVerfied();
|
||||
final boolean addCreateContactLink = allowCreation && isUnencrypted();
|
||||
final boolean addCreateGroupLinks = allowCreation && !isRelayingMessageContent(getActivity()) && !isMulti();
|
||||
final boolean addScanQRLink = allowCreation && !isMulti();
|
||||
|
||||
final int listflags = DcContext.DC_GCL_ADD_SELF;
|
||||
final int listflags = DcContext.DC_GCL_ADD_SELF | (isUnencrypted()? DcContext.DC_GCL_ADDRESS : 0);
|
||||
return new DcContactsLoader(getActivity(), listflags, cursorFilter, addCreateGroupLinks, addCreateContactLink, addScanQRLink, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -442,7 +442,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
menu.findItem(R.id.menu_show_map).setVisible(false);
|
||||
}
|
||||
|
||||
if (!dcChat.canSend() || dcChat.isMailingList() ) {
|
||||
if (!dcChat.isEncrypted() || !dcChat.canSend() || dcChat.isMailingList() ) {
|
||||
menu.findItem(R.id.menu_ephemeral_messages).setVisible(false);
|
||||
}
|
||||
|
||||
@@ -1610,7 +1610,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
}
|
||||
|
||||
public void initializeContactRequest() {
|
||||
if (!dcChat.isHalfBlocked()) {
|
||||
if (!dcChat.isContactRequest()) {
|
||||
messageRequestBottomView.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
@@ -1623,15 +1623,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
});
|
||||
|
||||
|
||||
if (dcChat.isProtectionBroken()) {
|
||||
messageRequestBottomView.setBlockText(R.string.more_info_desktop);
|
||||
String name = dcContext.getContact(recipient.getDcContact().getId()).getDisplayName();
|
||||
messageRequestBottomView.setBlockOnClickListener(v -> DcHelper.showVerificationBrokenDialog(this, name));
|
||||
|
||||
messageRequestBottomView.setQuestion(getString(R.string.chat_protection_broken, name));
|
||||
messageRequestBottomView.setAcceptText(R.string.ok);
|
||||
|
||||
} else if (dcChat.getType() == DcChat.DC_CHAT_TYPE_GROUP) {
|
||||
if (dcChat.getType() == DcChat.DC_CHAT_TYPE_GROUP) {
|
||||
// We don't support blocking groups yet, so offer to delete it instead
|
||||
messageRequestBottomView.setBlockText(R.string.delete);
|
||||
messageRequestBottomView.setBlockOnClickListener(v -> handleDeleteChat());
|
||||
|
||||
@@ -331,8 +331,7 @@ public class ConversationFragment extends MessageSelectorFragment
|
||||
menu.findItem(R.id.menu_context_share).setVisible(messageRecord.hasFile());
|
||||
boolean canReply = canReplyToMsg(messageRecord);
|
||||
menu.findItem(R.id.menu_context_reply).setVisible(chat.canSend() && canReply);
|
||||
boolean canEdit = canEditMsg(messageRecord);
|
||||
menu.findItem(R.id.menu_context_edit).setVisible(chat.canSend() && canEdit);
|
||||
menu.findItem(R.id.menu_context_edit).setVisible(chat.isEncrypted() && chat.canSend() && canEditMsg(messageRecord));
|
||||
boolean showReplyPrivately = chat.isMultiUser() && !messageRecord.isOutgoing() && canReply;
|
||||
menu.findItem(R.id.menu_context_reply_privately).setVisible(showReplyPrivately);
|
||||
menu.findItem(R.id.menu_add_to_home_screen).setVisible(messageRecord.getType() == DcMsg.DC_MSG_WEBXDC);
|
||||
@@ -825,7 +824,7 @@ public class ConversationFragment extends MessageSelectorFragment
|
||||
public void onShowFullClicked(DcMsg messageRecord) {
|
||||
Intent intent = new Intent(getActivity(), FullMsgActivity.class);
|
||||
intent.putExtra(FullMsgActivity.MSG_ID_EXTRA, messageRecord.getId());
|
||||
intent.putExtra(FullMsgActivity.BLOCK_LOADING_REMOTE, getListAdapter().getChat().isHalfBlocked());
|
||||
intent.putExtra(FullMsgActivity.BLOCK_LOADING_REMOTE, getListAdapter().getChat().isContactRequest());
|
||||
startActivity(intent);
|
||||
getActivity().overridePendingTransition(R.anim.slide_from_right, R.anim.fade_scale_out);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
// it is not needed to keep all past update messages, however, when deleted, also the strings should be deleted.
|
||||
try {
|
||||
DcContext dcContext = DcHelper.getContext(this);
|
||||
final String deviceMsgLabel = "update_1_50_0_android";
|
||||
final String deviceMsgLabel = "update_2_0_0_android-h";
|
||||
if (!dcContext.wasDeviceMsgEverAdded(deviceMsgLabel)) {
|
||||
DcMsg msg = null;
|
||||
if (!getIntent().getBooleanExtra(FROM_WELCOME, false)) {
|
||||
@@ -120,7 +120,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
// Util.copy(inputStream, new FileOutputStream(outputFile));
|
||||
// msg.setFile(outputFile, "image/jpeg");
|
||||
|
||||
msg.setText(getString(R.string.update_1_50_android, "https://get.delta.chat/#changelogs"));
|
||||
msg.setText(getString(R.string.update_2_0, "https://delta.chat/donate"));
|
||||
}
|
||||
dcContext.addDeviceMsg(deviceMsgLabel, msg);
|
||||
|
||||
@@ -133,19 +133,6 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
Prefs.setStringPreference(this, Prefs.LAST_DEVICE_MSG_LABEL, deviceMsgLabel);
|
||||
}
|
||||
|
||||
// add info about moved "switch profile" option; added 2024-08, can be removed after ~3 months
|
||||
if (!Prefs.getBooleanPreference(this, "info_about_switch_profile_added", false)) {
|
||||
final DcAccounts dcAccounts = DcHelper.getAccounts(this);
|
||||
if (dcAccounts.getAll().length >= 2) {
|
||||
DcMsg msg = new DcMsg(dcContext, DcMsg.DC_MSG_TEXT);
|
||||
msg.setText(getString(R.string.update_switch_profile_placement));
|
||||
dcContext.addDeviceMsg("info_about_switch_profile", msg);
|
||||
}
|
||||
Prefs.setBooleanPreference(this, "info_about_switch_profile_added", true);
|
||||
}
|
||||
// /add info
|
||||
|
||||
|
||||
// remove gmail oauth2
|
||||
final int serverFlags = dcContext.getConfigInt(CONFIG_SERVER_FLAGS);
|
||||
if ((serverFlags & DcContext.DC_LP_AUTH_OAUTH2)!=0) {
|
||||
|
||||
@@ -134,6 +134,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
this.fromView.setText(recipient, state!=DcMsg.DC_STATE_IN_FRESH);
|
||||
}
|
||||
|
||||
subjectView.setVisibility(chatId == DcChat.DC_CHAT_ID_ARCHIVED_LINK? GONE : VISIBLE);
|
||||
this.subjectView.setText(thread.getDisplayBody());
|
||||
this.subjectView.setTypeface(state==DcMsg.DC_STATE_IN_FRESH ? BOLD_TYPEFACE : LIGHT_TYPEFACE);
|
||||
this.subjectView.setTextColor(state==DcMsg.DC_STATE_IN_FRESH ? ThemeUtil.getThemedColor(getContext(), R.attr.conversation_list_item_unread_color)
|
||||
@@ -164,7 +165,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
fromView.setCompoundDrawablesWithIntrinsicBounds(
|
||||
thread.isMuted()? R.drawable.ic_volume_off_grey600_18dp : 0,
|
||||
0,
|
||||
thread.isProtected()? R.drawable.ic_verified : 0,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
|
||||
@@ -177,7 +178,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
|
||||
fromView.setText(getHighlightedSpan(contact.getDisplayName(), highlightSubstring));
|
||||
fromView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
subjectView.setText(getHighlightedSpan(contact.getAddr(), highlightSubstring));
|
||||
subjectView.setVisibility(GONE);
|
||||
dateView.setText("");
|
||||
dateView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
archivedBadgeView.setVisibility(GONE);
|
||||
@@ -201,6 +202,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
|
||||
fromView.setText(recipient, true);
|
||||
fromView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
subjectView.setVisibility(VISIBLE);
|
||||
subjectView.setText(getHighlightedSpan(messageResult.getSummarytext(512), highlightSubstring));
|
||||
|
||||
long timestamp = messageResult.getTimestamp();
|
||||
|
||||
@@ -68,17 +68,6 @@ public class ConversationTitleView extends RelativeLayout {
|
||||
title.setText(dcChat.getName());
|
||||
String subtitleStr = null;
|
||||
|
||||
// set icons etc.
|
||||
int imgLeft = 0;
|
||||
int imgRight = 0;
|
||||
|
||||
if (dcChat.isMuted()) {
|
||||
imgLeft = R.drawable.ic_volume_off_white_18dp;
|
||||
}
|
||||
if (dcChat.isProtected()) {
|
||||
imgRight = R.drawable.ic_verified;
|
||||
}
|
||||
|
||||
boolean isOnline = false;
|
||||
int[] chatContacts = dcContext.getChatContacts(chatId);
|
||||
if (dcChat.isMailingList()) {
|
||||
@@ -117,7 +106,8 @@ public class ConversationTitleView extends RelativeLayout {
|
||||
|
||||
avatar.setAvatar(glideRequests, new Recipient(getContext(), dcChat), false);
|
||||
avatar.setSeenRecently(isOnline);
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(imgLeft, 0, imgRight, 0);
|
||||
int imgLeft = dcChat.isMuted()? R.drawable.ic_volume_off_white_18dp : 0;
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(imgLeft, 0, 0, 0);
|
||||
if (!TextUtils.isEmpty(subtitleStr)) {
|
||||
subtitle.setText(subtitleStr);
|
||||
subtitle.setVisibility(View.VISIBLE);
|
||||
@@ -135,13 +125,7 @@ public class ConversationTitleView extends RelativeLayout {
|
||||
avatar.setAvatar(glideRequests, new Recipient(getContext(), contact), false);
|
||||
avatar.setSeenRecently(contact.wasSeenRecently());
|
||||
|
||||
int imgRight = 0;
|
||||
if (contact.isVerified()) {
|
||||
imgRight = R.drawable.ic_verified;
|
||||
}
|
||||
|
||||
title.setText(contact.getDisplayName());
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(0, 0, imgRight, 0);
|
||||
subtitle.setText(contact.getAddr());
|
||||
subtitle.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ public class ConversationUpdateItem extends BaseConversationItem
|
||||
{
|
||||
private DeliveryStatusView deliveryStatusView;
|
||||
private AppCompatImageView appIcon;
|
||||
private AppCompatImageView verifiedIcon;
|
||||
private int textColor;
|
||||
|
||||
public ConversationUpdateItem(Context context) {
|
||||
@@ -46,7 +45,6 @@ public class ConversationUpdateItem extends BaseConversationItem
|
||||
bodyText = findViewById(R.id.conversation_update_body);
|
||||
deliveryStatusView = new DeliveryStatusView(findViewById(R.id.delivery_indicator));
|
||||
appIcon = findViewById(R.id.app_icon);
|
||||
verifiedIcon = findViewById(R.id.verified_icon);
|
||||
|
||||
|
||||
bodyText.setOnLongClickListener(passthroughClickListener);
|
||||
@@ -113,16 +111,6 @@ public class ConversationUpdateItem extends BaseConversationItem
|
||||
appIcon.setVisibility(GONE);
|
||||
}
|
||||
|
||||
if (infoType == DcMsg.DC_INFO_PROTECTION_ENABLED) {
|
||||
verifiedIcon.setVisibility(VISIBLE);
|
||||
verifiedIcon.setImageResource(R.drawable.ic_verified);
|
||||
} else if (infoType == DcMsg.DC_INFO_PROTECTION_DISABLED) {
|
||||
verifiedIcon.setVisibility(VISIBLE);
|
||||
verifiedIcon.setImageResource(R.drawable.ic_verified_broken);
|
||||
} else {
|
||||
verifiedIcon.setVisibility(GONE);
|
||||
}
|
||||
|
||||
bodyText.setText(messageRecord.getDisplayBody());
|
||||
bodyText.setVisibility(VISIBLE);
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
public static final String EDIT_GROUP_CHAT_ID = "edit_group_chat_id";
|
||||
public static final String CREATE_BROADCAST = "create_broadcast";
|
||||
public static final String UNENCRYPTED = "unencrypted";
|
||||
public static final String CLONE_CHAT_EXTRA = "clone_chat";
|
||||
|
||||
private static final int PICK_CONTACT = 1;
|
||||
@@ -59,6 +60,7 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
private DcContext dcContext;
|
||||
|
||||
private boolean verified;
|
||||
private boolean unencrypted;
|
||||
private boolean broadcast;
|
||||
private EditText groupName;
|
||||
private ListView lv;
|
||||
@@ -76,6 +78,7 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
setContentView(R.layout.group_create_activity);
|
||||
verified = false;
|
||||
broadcast = getIntent().getBooleanExtra(CREATE_BROADCAST, false);
|
||||
unencrypted = getIntent().getBooleanExtra(UNENCRYPTED, false);
|
||||
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
|
||||
|
||||
@@ -90,11 +93,14 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
DcChat dcChat = dcContext.getChat(groupChatId);
|
||||
verified = dcChat.isProtected();
|
||||
broadcast = dcChat.isOutBroadcast();
|
||||
unencrypted = !dcChat.isEncrypted();
|
||||
}
|
||||
|
||||
int chatId = getIntent().getIntExtra(CLONE_CHAT_EXTRA, 0);
|
||||
if (chatId != 0) {
|
||||
broadcast = dcContext.getChat(chatId).isOutBroadcast();
|
||||
DcChat dcChat = dcContext.getChat(chatId);
|
||||
broadcast = dcChat.isOutBroadcast();
|
||||
unencrypted = !dcChat.isEncrypted();
|
||||
}
|
||||
|
||||
initializeResources();
|
||||
@@ -123,6 +129,9 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
else if(broadcast) {
|
||||
title = getString(R.string.new_channel);
|
||||
}
|
||||
else if(unencrypted) {
|
||||
title = getString(R.string.new_email);
|
||||
}
|
||||
else {
|
||||
title = getString(R.string.menu_new_group);
|
||||
}
|
||||
@@ -137,7 +146,7 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
initializeAvatarView();
|
||||
|
||||
SelectedContactsAdapter adapter = new SelectedContactsAdapter(this, GlideApp.with(this), broadcast);
|
||||
SelectedContactsAdapter adapter = new SelectedContactsAdapter(this, GlideApp.with(this), broadcast, unencrypted);
|
||||
adapter.setItemClickListener(this);
|
||||
lv.setAdapter(adapter);
|
||||
|
||||
@@ -163,6 +172,10 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
if (broadcast) {
|
||||
groupName.setHint(R.string.channel_name);
|
||||
chatHints.setVisibility(View.VISIBLE);
|
||||
} else if (unencrypted) {
|
||||
avatar.setVisibility(View.GONE);
|
||||
groupName.setHint(R.string.subject);
|
||||
chatHints.setVisibility(View.GONE);
|
||||
} else {
|
||||
chatHints.setVisibility(View.GONE);
|
||||
}
|
||||
@@ -219,7 +232,7 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
if (groupChatId != 0) {
|
||||
updateGroup(groupName);
|
||||
} else {
|
||||
verified = !broadcast && allMembersVerified();
|
||||
verified = !unencrypted && !broadcast && allMembersVerified();
|
||||
createGroup(groupName);
|
||||
}
|
||||
|
||||
@@ -244,6 +257,7 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
if (contactId == DcContact.DC_CONTACT_ID_ADD_MEMBER) {
|
||||
Intent intent = new Intent(this, ContactMultiSelectionActivity.class);
|
||||
intent.putExtra(ContactSelectionListFragment.SELECT_VERIFIED_EXTRA, verified);
|
||||
intent.putExtra(ContactSelectionListFragment.SELECT_UNENCRYPTED_EXTRA, unencrypted);
|
||||
ArrayList<Integer> preselectedContacts = new ArrayList<>(getAdapter().getContacts());
|
||||
intent.putExtra(ContactSelectionListFragment.PRESELECTED_CONTACTS, preselectedContacts);
|
||||
startActivityForResult(intent, PICK_CONTACT);
|
||||
@@ -263,6 +277,13 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
} else if (unencrypted) {
|
||||
try {
|
||||
groupChatId = DcHelper.getRpc(this).createGroupChatUnencrypted(dcContext.getAccountId(), groupName);
|
||||
} catch (RpcException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
groupChatId = dcContext.createGroupChat(verified, groupName);
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity
|
||||
finish();
|
||||
});
|
||||
|
||||
if(dcChat.canSend() && !dcChat.isSelfTalk() && dcMsg.isOutgoing()) {
|
||||
if(dcChat.isEncrypted() && dcChat.canSend() && !dcChat.isSelfTalk() && dcMsg.isOutgoing()) {
|
||||
builder.setNegativeButton(R.string.delete_for_everyone, (d, which) -> {
|
||||
Util.runOnAnyBackgroundThread(() -> dcContext.sendDeleteRequest(messageIds));
|
||||
finish();
|
||||
|
||||
@@ -64,7 +64,7 @@ public abstract class MessageSelectorFragment
|
||||
protected void handleDeleteMessages(int chatId, final int[] messageIds) {
|
||||
DcChat dcChat = dcContext.getChat(chatId);
|
||||
boolean canDeleteForAll = true;
|
||||
if (dcChat.canSend() && !dcChat.isSelfTalk()) {
|
||||
if (dcChat.isEncrypted() && dcChat.canSend() && !dcChat.isSelfTalk()) {
|
||||
for(int msgId : messageIds) {
|
||||
DcMsg msg = dcContext.getMsg(msgId);
|
||||
if (!msg.isOutgoing() || msg.isInfo()) {
|
||||
|
||||
@@ -102,6 +102,10 @@ public class NewConversationActivity extends ContactSelectionActivity {
|
||||
public void onContactSelected(int contactId) {
|
||||
if(contactId == DcContact.DC_CONTACT_ID_NEW_GROUP) {
|
||||
startActivity(new Intent(this, GroupCreateActivity.class));
|
||||
} else if(contactId == DcContact.DC_CONTACT_ID_NEW_UNENCRYPTED_GROUP) {
|
||||
Intent intent = new Intent(this, GroupCreateActivity.class);
|
||||
intent.putExtra(GroupCreateActivity.UNENCRYPTED, true);
|
||||
startActivity(intent);
|
||||
} else if(contactId == DcContact.DC_CONTACT_ID_NEW_BROADCAST) {
|
||||
Intent intent = new Intent(this, GroupCreateActivity.class);
|
||||
intent.putExtra(GroupCreateActivity.CREATE_BROADCAST, true);
|
||||
|
||||
@@ -315,10 +315,12 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
String profileImagePath;
|
||||
String title;
|
||||
Uri profileImageUri;
|
||||
boolean enlargeAvatar = true;
|
||||
if(chatId!=0) {
|
||||
DcChat dcChat = dcContext.getChat(chatId);
|
||||
profileImagePath = dcChat.getProfileImage();
|
||||
title = dcChat.getName();
|
||||
enlargeAvatar = dcChat.isEncrypted() && !dcChat.isSelfTalk() && !dcChat.isDeviceTalk();
|
||||
} else {
|
||||
DcContact dcContact = dcContext.getContact(contactId);
|
||||
profileImagePath = dcContact.getProfileImage();
|
||||
@@ -327,7 +329,7 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
File file = new File(profileImagePath);
|
||||
|
||||
if (file.exists()) {
|
||||
if (enlargeAvatar && file.exists()) {
|
||||
profileImageUri = Uri.fromFile(file);
|
||||
String type = "image/" + profileImagePath.substring(profileImagePath.lastIndexOf(".") + 1);
|
||||
|
||||
@@ -388,7 +390,12 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
private void onShare() {
|
||||
Intent composeIntent = new Intent();
|
||||
RelayUtil.setSharedContactId(composeIntent, contactId);
|
||||
DcContact dcContact = dcContext.getContact(contactId);
|
||||
if (dcContact.isKeyContact()) {
|
||||
RelayUtil.setSharedContactId(composeIntent, contactId);
|
||||
} else {
|
||||
RelayUtil.setSharedText(composeIntent, dcContact.getAddr());
|
||||
}
|
||||
ConversationListRelayingActivity.start(this, composeIntent);
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,8 @@ public class ProfileAdapter extends RecyclerView.Adapter
|
||||
else if(holder.itemView instanceof ProfileTextItem) {
|
||||
ProfileTextItem item = (ProfileTextItem) holder.itemView;
|
||||
item.setOnClickListener(view -> clickListener.onSettingsClicked(data.viewType));
|
||||
item.set(data.label, data.icon);
|
||||
boolean tintIcon = data.viewType != ITEM_INTRODUCED_BY;
|
||||
item.set(data.label, data.icon, tintIcon);
|
||||
if (data.viewType == ITEM_LAST_SEEN || data.viewType == ITEM_ADDRESS) {
|
||||
int padding = (int)((float)context.getResources().getDimensionPixelSize(R.dimen.contact_list_normal_padding) * 1.2);
|
||||
item.setPadding(item.getPaddingLeft(), item.getPaddingTop(), item.getPaddingRight(), padding);
|
||||
@@ -339,7 +340,10 @@ public class ProfileAdapter extends RecyclerView.Adapter
|
||||
} else {
|
||||
introducedBy = context.getString(R.string.verified_by, dcContext.getContact(verifierId).getDisplayName());
|
||||
}
|
||||
itemData.add(new ItemData(ITEM_INTRODUCED_BY, introducedBy, 0));
|
||||
itemData.add(new ItemData(ITEM_INTRODUCED_BY, introducedBy, dcContact.isVerified()? R.drawable.ic_verified : 0));
|
||||
} else if (dcContact.isVerified()) {
|
||||
String introducedBy = context.getString(R.string.verified_by_unknown);
|
||||
itemData.add(new ItemData(ITEM_INTRODUCED_BY, introducedBy, R.drawable.ic_verified));
|
||||
}
|
||||
|
||||
if (dcContact != null) {
|
||||
|
||||
@@ -50,12 +50,10 @@ public class ProfileAvatarItem extends LinearLayout implements RecipientModified
|
||||
this.glideRequests = glideRequests;
|
||||
|
||||
String name = "";
|
||||
boolean greenCheckmark = false;
|
||||
String subtitle = null;
|
||||
if (dcChat != null) {
|
||||
recipient = new Recipient(getContext(), dcChat);
|
||||
name = dcChat.getName();
|
||||
greenCheckmark = dcChat.isProtected();
|
||||
|
||||
if (dcChat.isMailingList()) {
|
||||
subtitle = dcChat.getMailinglistAddr();
|
||||
@@ -67,7 +65,6 @@ public class ProfileAvatarItem extends LinearLayout implements RecipientModified
|
||||
} else if (dcContact != null) {
|
||||
recipient = new Recipient(getContext(), dcContact);
|
||||
name = dcContact.getDisplayName();
|
||||
greenCheckmark = dcContact.isVerified();
|
||||
}
|
||||
|
||||
recipient.addListener(this);
|
||||
@@ -75,7 +72,6 @@ public class ProfileAvatarItem extends LinearLayout implements RecipientModified
|
||||
avatarView.setSeenRecently(dcContact != null && dcContact.wasSeenRecently());
|
||||
|
||||
nameView.setText(name);
|
||||
nameView.setCompoundDrawablesWithIntrinsicBounds(0,0, greenCheckmark ? R.drawable.ic_verified : 0, 0);
|
||||
|
||||
if (subtitle != null) {
|
||||
subtitleView.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ProfileTextItem extends LinearLayout {
|
||||
valueView = findViewById(R.id.value);
|
||||
}
|
||||
|
||||
public void set(String label, int icon) {
|
||||
public void set(String label, int icon, boolean tint) {
|
||||
labelView.setText(label);
|
||||
|
||||
if (icon != 0) {
|
||||
@@ -42,7 +42,9 @@ public class ProfileTextItem extends LinearLayout {
|
||||
if (orgDrawable != null) {
|
||||
Drawable drawable = orgDrawable.mutate(); // avoid global state modification and showing eg. app-icon tinted also elsewhere
|
||||
drawable = DrawableCompat.wrap(drawable);
|
||||
DrawableCompat.setTint(drawable, getResources().getColor(R.color.delta_accent));
|
||||
if (tint) {
|
||||
DrawableCompat.setTint(drawable, getResources().getColor(R.color.delta_accent));
|
||||
}
|
||||
labelView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +51,13 @@ public class DcContactsLoader extends AsyncLoader<DcContactsLoader.Ret> {
|
||||
}
|
||||
if (query == null && addCreateGroupLinks) {
|
||||
additional_items = Util.appendInt(additional_items, DcContact.DC_CONTACT_ID_NEW_GROUP);
|
||||
|
||||
final boolean broadcastsEnabled = Prefs.isNewBroadcastAvailable(getContext());
|
||||
if (broadcastsEnabled) additional_items = Util.appendInt(additional_items, DcContact.DC_CONTACT_ID_NEW_BROADCAST);
|
||||
|
||||
if (!dcContext.isChatmail()) {
|
||||
additional_items = Util.appendInt(additional_items, DcContact.DC_CONTACT_ID_NEW_UNENCRYPTED_GROUP);
|
||||
}
|
||||
}
|
||||
int[] all_ids = new int[contact_ids.length + additional_items.length];
|
||||
System.arraycopy(additional_items, 0, all_ids, 0, additional_items.length);
|
||||
|
||||
@@ -152,11 +152,8 @@ public class DcHelper {
|
||||
dcContext.setStockTranslation(11, context.getString(R.string.audio));
|
||||
dcContext.setStockTranslation(12, context.getString(R.string.file));
|
||||
dcContext.setStockTranslation(23, context.getString(R.string.gif));
|
||||
dcContext.setStockTranslation(24, context.getString(R.string.encrypted_message));
|
||||
dcContext.setStockTranslation(29, context.getString(R.string.systemmsg_cannot_decrypt));
|
||||
dcContext.setStockTranslation(35, context.getString(R.string.contact_verified));
|
||||
dcContext.setStockTranslation(36, context.getString(R.string.contact_not_verified));
|
||||
dcContext.setStockTranslation(37, context.getString(R.string.contact_setup_changed));
|
||||
dcContext.setStockTranslation(40, context.getString(R.string.chat_archived_label));
|
||||
dcContext.setStockTranslation(60, context.getString(R.string.login_error_cannot_login));
|
||||
dcContext.setStockTranslation(66, context.getString(R.string.location));
|
||||
@@ -190,7 +187,6 @@ public class DcHelper {
|
||||
dcContext.setStockTranslation(112, context.getString(R.string.error_x));
|
||||
dcContext.setStockTranslation(113, context.getString(R.string.not_supported_by_provider));
|
||||
dcContext.setStockTranslation(114, context.getString(R.string.messages));
|
||||
dcContext.setStockTranslation(115, context.getString(R.string.channel));
|
||||
dcContext.setStockTranslation(116, context.getString(R.string.part_of_total_used));
|
||||
dcContext.setStockTranslation(117, context.getString(R.string.secure_join_started));
|
||||
dcContext.setStockTranslation(118, context.getString(R.string.secure_join_replies));
|
||||
@@ -236,22 +232,15 @@ public class DcHelper {
|
||||
// cmp. https://github.com/deltachat/deltachat-android/issues/2187
|
||||
dcContext.setStockTranslation(120, context.getString(R.string.qrshow_join_group_hint).replace("\"", ""));
|
||||
dcContext.setStockTranslation(121, context.getString(R.string.connectivity_not_connected));
|
||||
dcContext.setStockTranslation(122, context.getString(R.string.aeap_addr_changed));
|
||||
dcContext.setStockTranslation(162, context.getString(R.string.multidevice_qr_subtitle));
|
||||
dcContext.setStockTranslation(163, context.getString(R.string.multidevice_transfer_done_devicemsg));
|
||||
|
||||
// The next two strings should only be set if the UI actually shows more info when the user clicks on the
|
||||
// DC_INFO_PROTECTION_{EN|DIS}ABLED info message
|
||||
dcContext.setStockTranslation(170, context.getString(R.string.chat_protection_enabled_tap_to_learn_more));
|
||||
dcContext.setStockTranslation(171, context.getString(R.string.chat_protection_broken_tap_to_learn_more));
|
||||
|
||||
dcContext.setStockTranslation(172, context.getString(R.string.chat_new_group_hint));
|
||||
dcContext.setStockTranslation(173, context.getString(R.string.member_x_added));
|
||||
dcContext.setStockTranslation(174, context.getString(R.string.invalid_unencrypted_tap_to_learn_more));
|
||||
dcContext.setStockTranslation(176, context.getString(R.string.reaction_by_you));
|
||||
dcContext.setStockTranslation(177, context.getString(R.string.reaction_by_other));
|
||||
dcContext.setStockTranslation(190, context.getString(R.string.secure_join_wait));
|
||||
dcContext.setStockTranslation(192, context.getString(R.string.secure_join_takes_longer));
|
||||
dcContext.setStockTranslation(193, context.getString(R.string.donate_device_msg));
|
||||
}
|
||||
|
||||
@@ -464,20 +453,10 @@ public class DcHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public static void showVerificationBrokenDialog(Context context, String name) {
|
||||
new AlertDialog.Builder(context)
|
||||
.setMessage(context.getString(R.string.chat_protection_broken_explanation, name))
|
||||
.setNeutralButton(R.string.learn_more, (d, w) -> openHelp(context, "#nocryptanymore"))
|
||||
.setNegativeButton(R.string.qrscan_title, (d, w) -> context.startActivity(new Intent(context, QrActivity.class)))
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setCancelable(true)
|
||||
.show();
|
||||
}
|
||||
|
||||
public static void showProtectionEnabledDialog(Context context) {
|
||||
new AlertDialog.Builder(context)
|
||||
.setMessage(context.getString(R.string.chat_protection_enabled_explanation))
|
||||
.setNeutralButton(R.string.learn_more, (d, w) -> openHelp(context, "#e2eeguarantee"))
|
||||
.setNeutralButton(R.string.learn_more, (d, w) -> openHelp(context, "#e2ee"))
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setCancelable(true)
|
||||
.show();
|
||||
|
||||
@@ -268,6 +268,8 @@ public class ContactSelectionListAdapter extends RecyclerView.Adapter<ContactSel
|
||||
itemMultiSelect = false; // the item creates a new contact in the list that will be selected instead
|
||||
} else if (id == DcContact.DC_CONTACT_ID_NEW_GROUP) {
|
||||
name = context.getString(R.string.menu_new_group);
|
||||
} else if (id == DcContact.DC_CONTACT_ID_NEW_UNENCRYPTED_GROUP) {
|
||||
name = context.getString(R.string.new_email);
|
||||
} else if (id == DcContact.DC_CONTACT_ID_NEW_BROADCAST) {
|
||||
name = context.getString(R.string.new_channel);
|
||||
} else if (id == DcContact.DC_CONTACT_ID_QR_INVITE) {
|
||||
|
||||
@@ -64,9 +64,12 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
|
||||
this.name = name;
|
||||
this.number = number;
|
||||
|
||||
if (specialId==DcContact.DC_CONTACT_ID_NEW_CLASSIC_CONTACT || specialId==DcContact.DC_CONTACT_ID_NEW_GROUP
|
||||
if (specialId==DcContact.DC_CONTACT_ID_NEW_CLASSIC_CONTACT
|
||||
|| specialId==DcContact.DC_CONTACT_ID_NEW_GROUP
|
||||
|| specialId==DcContact.DC_CONTACT_ID_NEW_UNENCRYPTED_GROUP
|
||||
|| specialId==DcContact.DC_CONTACT_ID_NEW_BROADCAST
|
||||
|| specialId==DcContact.DC_CONTACT_ID_ADD_MEMBER || specialId==DcContact.DC_CONTACT_ID_QR_INVITE) {
|
||||
|| specialId==DcContact.DC_CONTACT_ID_ADD_MEMBER
|
||||
|| specialId==DcContact.DC_CONTACT_ID_QR_INVITE) {
|
||||
this.nameView.setTypeface(null, Typeface.BOLD);
|
||||
}
|
||||
else {
|
||||
@@ -120,11 +123,6 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
|
||||
else {
|
||||
this.numberContainer.setVisibility(View.GONE);
|
||||
}
|
||||
if (contact != null && contact.isVerified()) {
|
||||
nameView.setCompoundDrawablesWithIntrinsicBounds(0,0,R.drawable.ic_verified,0);
|
||||
} else {
|
||||
nameView.setCompoundDrawablesWithIntrinsicBounds(0,0, 0,0);
|
||||
}
|
||||
}
|
||||
|
||||
public int getSpecialId() {
|
||||
|
||||
@@ -58,7 +58,12 @@ public class LongClickCopySpan extends ClickableSpan {
|
||||
String addr = prepareUrl(url);
|
||||
Activity activity = (Activity) widget.getContext();
|
||||
DcContext dcContext = DcHelper.getContext(activity);
|
||||
DcContact contact = dcContext.getContact(dcContext.createContact(null, addr));
|
||||
|
||||
int contactId = dcContext.lookupContactIdByAddr(addr);
|
||||
if (contactId == 0 && dcContext.mayBeValidAddr(addr)) {
|
||||
contactId = dcContext.createContact(null, addr);
|
||||
}
|
||||
DcContact contact = dcContext.getContact(contactId);
|
||||
if (contact.getId() != 0 && !contact.isBlocked() && dcContext.getChatIdByContactId(contact.getId()) != 0) {
|
||||
openChat(activity, contact);
|
||||
} else {
|
||||
|
||||
@@ -37,16 +37,18 @@ public class SelectedContactsAdapter extends BaseAdapter {
|
||||
@Nullable private ItemClickListener itemClickListener;
|
||||
@NonNull private final List<Integer> contacts = new LinkedList<>();
|
||||
private final boolean isBroadcast;
|
||||
private final boolean isUnencrypted;
|
||||
@NonNull private final DcContext dcContext;
|
||||
@NonNull private final GlideRequests glideRequests;
|
||||
|
||||
public SelectedContactsAdapter(@NonNull Context context,
|
||||
@NonNull GlideRequests glideRequests,
|
||||
boolean isBroadcast)
|
||||
boolean isBroadcast, boolean isUnencrypted)
|
||||
{
|
||||
this.context = context;
|
||||
this.glideRequests = glideRequests;
|
||||
this.isBroadcast = isBroadcast;
|
||||
this.isUnencrypted = isUnencrypted;
|
||||
this.dcContext = DcHelper.getContext(context);
|
||||
}
|
||||
|
||||
@@ -109,10 +111,9 @@ public class SelectedContactsAdapter extends BaseAdapter {
|
||||
final int contactId = (int)getItem(position);
|
||||
final boolean modifiable = contactId != DC_CONTACT_ID_ADD_MEMBER && contactId != DC_CONTACT_ID_SELF;
|
||||
Recipient recipient = null;
|
||||
boolean verified = false;
|
||||
|
||||
if(contactId == DcContact.DC_CONTACT_ID_ADD_MEMBER) {
|
||||
name.setText(context.getString(isBroadcast? R.string.add_recipients : R.string.group_add_members));
|
||||
name.setText(context.getString(isBroadcast || isUnencrypted? R.string.add_recipients : R.string.group_add_members));
|
||||
name.setTypeface(null, Typeface.BOLD);
|
||||
phone.setVisibility(View.GONE);
|
||||
} else {
|
||||
@@ -122,12 +123,10 @@ public class SelectedContactsAdapter extends BaseAdapter {
|
||||
name.setTypeface(null, Typeface.NORMAL);
|
||||
phone.setText(dcContact.getAddr());
|
||||
phone.setVisibility(View.VISIBLE);
|
||||
verified = dcContact.isVerified();
|
||||
}
|
||||
|
||||
avatar.clear(glideRequests);
|
||||
avatar.setAvatar(glideRequests, recipient, false);
|
||||
name.setCompoundDrawablesWithIntrinsicBounds(0, 0, verified? R.drawable.ic_verified : 0, 0);
|
||||
delete.setVisibility(modifiable ? View.VISIBLE : View.GONE);
|
||||
delete.setColorFilter(DynamicTheme.isDarkTheme(context)? Color.WHITE : Color.BLACK);
|
||||
delete.setOnClickListener(view -> {
|
||||
|
||||
Reference in New Issue
Block a user