mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge branch 'main' into adb/issue-3959
This commit is contained in:
@@ -53,6 +53,7 @@ public class DcContext {
|
||||
|
||||
public final static int DC_QR_ASK_VERIFYCONTACT = 200;
|
||||
public final static int DC_QR_ASK_VERIFYGROUP = 202;
|
||||
public final static int DC_QR_ASK_JOIN_BROADCAST= 204;
|
||||
public final static int DC_QR_FPR_OK = 210;
|
||||
public final static int DC_QR_FPR_MISMATCH = 220;
|
||||
public final static int DC_QR_FPR_WITHOUT_ADDR = 230;
|
||||
|
||||
@@ -1152,7 +1152,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
if (doSend) {
|
||||
if (dcContext.sendMsg(dcChat.getId(), msg) == 0) {
|
||||
Util.runOnMain(()-> Toast.makeText(ConversationActivity.this, dcContext.getLastError(), Toast.LENGTH_LONG).show());
|
||||
String lastError = dcContext.getLastError();
|
||||
if (!"".equals(lastError)) {
|
||||
Util.runOnMain(() -> Toast.makeText(ConversationActivity.this, lastError, Toast.LENGTH_LONG).show());
|
||||
}
|
||||
future.set(chatId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
if (chatId != 0) {
|
||||
DcChat dcChat = dcContext.getChat(chatId);
|
||||
menu.findItem(R.id.menu_clone).setVisible(chatIsMultiUser && !chatIsInBroadcast && !chatIsMailingList);
|
||||
menu.findItem(R.id.menu_clone).setVisible(chatIsMultiUser && !chatIsInBroadcast && !chatIsOutBroadcast && !chatIsMailingList);
|
||||
if (chatIsDeviceTalk) {
|
||||
menu.findItem(R.id.edit_name).setVisible(false);
|
||||
menu.findItem(R.id.show_encr_info).setVisible(false);
|
||||
|
||||
@@ -314,10 +314,10 @@ public class ProfileAdapter extends RecyclerView.Adapter
|
||||
itemData.add(new ItemData(ITEM_DIVIDER, null, 0));
|
||||
if (dcChat != null) {
|
||||
if (dcChat.canSend() && dcChat.isEncrypted()) {
|
||||
itemData.add(new ItemData(ITEM_MEMBERS, DcContact.DC_CONTACT_ID_ADD_MEMBER, 0));
|
||||
if (!isOutBroadcast) {
|
||||
itemData.add(new ItemData(ITEM_MEMBERS, DcContact.DC_CONTACT_ID_QR_INVITE, 0));
|
||||
itemData.add(new ItemData(ITEM_MEMBERS, DcContact.DC_CONTACT_ID_ADD_MEMBER, 0));
|
||||
}
|
||||
itemData.add(new ItemData(ITEM_MEMBERS, DcContact.DC_CONTACT_ID_QR_INVITE, 0));
|
||||
}
|
||||
}
|
||||
for (int value : memberList) {
|
||||
|
||||
@@ -43,6 +43,7 @@ public class QrCodeHandler {
|
||||
switch (qrParsed.getState()) {
|
||||
case DcContext.DC_QR_ASK_VERIFYCONTACT:
|
||||
case DcContext.DC_QR_ASK_VERIFYGROUP:
|
||||
case DcContext.DC_QR_ASK_JOIN_BROADCAST:
|
||||
showVerifyContactOrGroup(activity, builder, rawString, qrParsed, name);
|
||||
break;
|
||||
|
||||
@@ -216,6 +217,9 @@ public class QrCodeHandler {
|
||||
case DcContext.DC_QR_ASK_VERIFYGROUP:
|
||||
msg = activity.getString(R.string.qrscan_ask_join_group, qrParsed.getText1());
|
||||
break;
|
||||
case DcContext.DC_QR_ASK_JOIN_BROADCAST:
|
||||
msg = activity.getString(R.string.qrscan_ask_join_channel, qrParsed.getText1());
|
||||
break;
|
||||
default:
|
||||
msg = activity.getString(R.string.ask_start_chat_with, name);
|
||||
break;
|
||||
|
||||
@@ -54,7 +54,9 @@ public class SelectedContactsAdapter extends BaseAdapter {
|
||||
|
||||
public void changeData(Collection<Integer> contactIds) {
|
||||
contacts.clear();
|
||||
contacts.add(DC_CONTACT_ID_ADD_MEMBER);
|
||||
if (!isBroadcast) {
|
||||
contacts.add(DC_CONTACT_ID_ADD_MEMBER);
|
||||
}
|
||||
if (contactIds != null) {
|
||||
for (int id : contactIds) {
|
||||
if (id != DC_CONTACT_ID_SELF) {
|
||||
@@ -75,7 +77,7 @@ public class SelectedContactsAdapter extends BaseAdapter {
|
||||
}
|
||||
|
||||
public Set<Integer> getContacts() {
|
||||
final Set<Integer> set = new HashSet<>(contacts.size()-1);
|
||||
final Set<Integer> set = new HashSet<>(contacts.size());
|
||||
for (int i = 1; i < contacts.size(); i++) {
|
||||
set.add(contacts.get(i));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user