mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
remove deprecated chat verification code
This commit is contained in:
@@ -44,7 +44,6 @@ public class DcChat {
|
||||
public native boolean isSelfTalk ();
|
||||
public native boolean isDeviceTalk ();
|
||||
public native boolean canSend ();
|
||||
public native boolean isProtected ();
|
||||
public native boolean isSendingLocations();
|
||||
public native boolean isMuted ();
|
||||
public native boolean isContactRequest ();
|
||||
|
||||
@@ -165,7 +165,7 @@ public class DcContext {
|
||||
public native void setChatVisibility (int chat_id, int visibility);
|
||||
public native int getChatIdByContactId (int contact_id);
|
||||
public native int createChatByContactId(int contact_id);
|
||||
public native int createGroupChat (boolean verified, String name);
|
||||
public native int createGroupChat (String name);
|
||||
public native int createBroadcastList ();
|
||||
public native boolean isContactInChat (int chat_id, int contact_id);
|
||||
public native int addContactToChat (int chat_id, int contact_id);
|
||||
|
||||
@@ -79,7 +79,6 @@ public class ContactSelectionListFragment extends Fragment
|
||||
private static final String TAG = ContactSelectionListFragment.class.getSimpleName();
|
||||
|
||||
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";
|
||||
@@ -240,10 +239,6 @@ public class ContactSelectionListFragment extends Fragment
|
||||
return getActivity().getIntent().getBooleanExtra(MULTI_SELECT, false);
|
||||
}
|
||||
|
||||
private boolean isSelectVerfied() {
|
||||
return getActivity().getIntent().getBooleanExtra(SELECT_VERIFIED_EXTRA, false);
|
||||
}
|
||||
|
||||
private boolean isUnencrypted() {
|
||||
return getActivity().getIntent().getBooleanExtra(SELECT_UNENCRYPTED_EXTRA, false);
|
||||
}
|
||||
@@ -348,17 +343,6 @@ public class ContactSelectionListFragment extends Fragment
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSelectVerfied() && !contact.getDcContact().isVerified()) {
|
||||
new AlertDialog.Builder(getActivity())
|
||||
.setMessage(R.string.verified_contact_required_explain)
|
||||
.setNeutralButton(R.string.learn_more, (d, w) -> DcHelper.openHelp(getActivity(), "#howtoe2ee"))
|
||||
.setNegativeButton(R.string.qrscan_title, (d, w) -> getActivity().startActivity(new Intent(getActivity(), QrActivity.class)))
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setCancelable(true)
|
||||
.show();
|
||||
return;
|
||||
}
|
||||
|
||||
selectedContacts.add(contactId);
|
||||
contact.setChecked(true);
|
||||
if (onContactSelectedListener != null) {
|
||||
|
||||
@@ -60,7 +60,6 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
private DcContext dcContext;
|
||||
|
||||
private boolean verified;
|
||||
private boolean unencrypted;
|
||||
private boolean broadcast;
|
||||
private EditText groupName;
|
||||
@@ -77,7 +76,6 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
protected void onCreate(Bundle state, boolean ready) {
|
||||
dcContext = DcHelper.getContext(this);
|
||||
setContentView(R.layout.group_create_activity);
|
||||
verified = false;
|
||||
broadcast = getIntent().getBooleanExtra(CREATE_BROADCAST, false);
|
||||
unencrypted = getIntent().getBooleanExtra(UNENCRYPTED, false);
|
||||
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
|
||||
@@ -93,7 +91,6 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
if(groupChatId !=0) {
|
||||
isEdit = true;
|
||||
DcChat dcChat = dcContext.getChat(groupChatId);
|
||||
verified = dcChat.isProtected();
|
||||
broadcast = dcChat.isOutBroadcast();
|
||||
unencrypted = !dcChat.isEncrypted();
|
||||
}
|
||||
@@ -234,7 +231,6 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
if (groupChatId != 0) {
|
||||
updateGroup(groupName);
|
||||
} else {
|
||||
verified = !unencrypted && !broadcast && allMembersVerified();
|
||||
createGroup(groupName);
|
||||
}
|
||||
|
||||
@@ -244,21 +240,10 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean allMembersVerified() {
|
||||
for (int id : getAdapter().getContacts()) {
|
||||
DcContact contact = dcContext.getContact(id);
|
||||
if (contact != null && !contact.isVerified()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(int contactId) {
|
||||
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);
|
||||
@@ -287,7 +272,7 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
groupChatId = dcContext.createGroupChat(verified, groupName);
|
||||
groupChatId = dcContext.createGroupChat(groupName);
|
||||
}
|
||||
|
||||
for (int contactId : getAdapter().getContacts()) {
|
||||
|
||||
@@ -201,7 +201,6 @@ public class ProfileFragment extends Fragment
|
||||
public void onAddMember() {
|
||||
DcChat dcChat = dcContext.getChat(chatId);
|
||||
Intent intent = new Intent(getContext(), ContactMultiSelectionActivity.class);
|
||||
intent.putExtra(ContactSelectionListFragment.SELECT_VERIFIED_EXTRA, dcChat.isProtected());
|
||||
ArrayList<Integer> preselectedContacts = new ArrayList<>();
|
||||
for (int memberId : dcContext.getChatContacts(chatId)) {
|
||||
preselectedContacts.add(memberId);
|
||||
|
||||
@@ -396,7 +396,7 @@ public class DcHelper {
|
||||
|
||||
return new ThreadRecord(body, recipient, date,
|
||||
unreadCount, chatId,
|
||||
chat.getVisibility(), chat.isProtected(), chat.isSendingLocations(), chat.isMuted(), chat.isContactRequest(), summary);
|
||||
chat.getVisibility(), chat.isSendingLocations(), chat.isMuted(), chat.isContactRequest(), summary);
|
||||
}
|
||||
|
||||
public static boolean isNetworkConnected(Context context) {
|
||||
|
||||
@@ -43,7 +43,6 @@ public class ThreadRecord {
|
||||
|
||||
private final int unreadCount;
|
||||
private final int visibility;
|
||||
private final boolean isProtected;
|
||||
private final boolean isSendingLocations;
|
||||
private final boolean isMuted;
|
||||
private final boolean isContactRequest;
|
||||
@@ -53,7 +52,6 @@ public class ThreadRecord {
|
||||
@NonNull Recipient recipient, long dateReceived, int unreadCount,
|
||||
long threadId,
|
||||
int visibility,
|
||||
boolean isProtected,
|
||||
boolean isSendingLocations,
|
||||
boolean isMuted,
|
||||
boolean isContactRequest,
|
||||
@@ -65,7 +63,6 @@ public class ThreadRecord {
|
||||
this.body = body;
|
||||
this.unreadCount = unreadCount;
|
||||
this.visibility = visibility;
|
||||
this.isProtected = isProtected;
|
||||
this.isSendingLocations = isSendingLocations;
|
||||
this.isMuted = isMuted;
|
||||
this.isContactRequest = isContactRequest;
|
||||
@@ -116,10 +113,6 @@ public class ThreadRecord {
|
||||
return visibility;
|
||||
}
|
||||
|
||||
public boolean isProtected() {
|
||||
return isProtected;
|
||||
}
|
||||
|
||||
public boolean isSendingLocations() {
|
||||
return isSendingLocations;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user