mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Show receivers email-address when send messages from extern.
This commit is contained in:
@@ -148,4 +148,20 @@ public class MrChat {
|
||||
{
|
||||
setDraft(null, 0);
|
||||
}
|
||||
|
||||
public String getNameNAddr()
|
||||
{
|
||||
// returns name of group chats or name+e-mail-address for normal chats
|
||||
String name = "ErrGrpNameNAddr";
|
||||
if( getType()==MR_CHAT_GROUP ) {
|
||||
name = getName();
|
||||
}
|
||||
else {
|
||||
int contacts[] = MrMailbox.getChatContacts(getId());
|
||||
if( contacts.length==1 ) {
|
||||
name = MrMailbox.getContact(contacts[0]).getNameNAddr();
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
private boolean checkPermission = true;
|
||||
|
||||
private String selectAlertString;
|
||||
private String addToGroupAlertString;
|
||||
|
||||
private static boolean dialogsLoaded;
|
||||
private boolean searching;
|
||||
@@ -134,7 +133,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
if (getArguments() != null) {
|
||||
onlySelect = arguments.getBoolean("onlySelect", false);
|
||||
selectAlertString = arguments.getString("selectAlertString");
|
||||
addToGroupAlertString = arguments.getString("addToGroupAlertString");
|
||||
}
|
||||
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.dialogsNeedReload);
|
||||
@@ -716,17 +714,15 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
}
|
||||
|
||||
private void didSelectResult(final long dialog_id, boolean useAlert, final boolean param) {
|
||||
if (useAlert && (selectAlertString != null || addToGroupAlertString != null)) {
|
||||
if (useAlert && (selectAlertString != null )) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
}
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
|
||||
MrChat mrChat = MrMailbox.getChat((int)dialog_id);
|
||||
if (addToGroupAlertString != null) {
|
||||
builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatStringSimple(addToGroupAlertString, mrChat.getName())));
|
||||
} else {
|
||||
builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatStringSimple(selectAlertString, mrChat.getName())));
|
||||
}
|
||||
builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatStringSimple(selectAlertString,
|
||||
mrChat.getNameNAddr() /*display addr as there may be contacts with the same name but different addresses*/)));
|
||||
|
||||
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user