mirror of
https://github.com/DrKLO/Telegram.git
synced 2025-01-03 09:49:15 +01:00
Ask confirmation when starting secret chat and sharing contact info
Thanks to https://github.com/DrKLO/Telegram/pull/401
This commit is contained in:
parent
63ba8a5ac1
commit
cdb39ac30f
4 changed files with 31 additions and 10 deletions
|
@ -82,7 +82,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
targetSdkVersion 19
|
targetSdkVersion 19
|
||||||
versionCode 237
|
versionCode 238
|
||||||
versionName "1.4.15"
|
versionName "1.4.15"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2566,6 +2566,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
|
||||||
topPanel.setOnClickListener(new View.OnClickListener() {
|
topPanel.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||||
|
builder.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure));
|
||||||
|
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||||
|
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
MessagesController.getInstance().hidenAddToContacts.put(currentUser.id, currentUser);
|
MessagesController.getInstance().hidenAddToContacts.put(currentUser.id, currentUser);
|
||||||
topPanel.setVisibility(View.GONE);
|
topPanel.setVisibility(View.GONE);
|
||||||
MessagesController.getInstance().sendMessage(UserConfig.currentUser, dialog_id);
|
MessagesController.getInstance().sendMessage(UserConfig.currentUser, dialog_id);
|
||||||
|
@ -2577,6 +2583,11 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||||
|
visibleDialog = builder.show();
|
||||||
|
visibleDialog.setCanceledOnTouchOutside(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,10 +211,20 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
|
||||||
startSecretButton.setOnClickListener(new View.OnClickListener() {
|
startSecretButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||||
|
builder.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure));
|
||||||
|
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||||
|
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
creatingChat = true;
|
creatingChat = true;
|
||||||
MessagesController.getInstance().startSecretChat(getParentActivity(), MessagesController.getInstance().users.get(user_id));
|
MessagesController.getInstance().startSecretChat(getParentActivity(), MessagesController.getInstance().users.get(user_id));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||||
|
builder.show().setCanceledOnTouchOutside(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
if (dialog_id == 0) {
|
if (dialog_id == 0) {
|
||||||
startSecretButton.setVisibility(View.VISIBLE);
|
startSecretButton.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -326,7 +326,7 @@ public class ActionBarActivity extends Activity {
|
||||||
});
|
});
|
||||||
velocityTracker.recycle();
|
velocityTracker.recycle();
|
||||||
velocityTracker = null;
|
velocityTracker = null;
|
||||||
} else if (ev == null) {
|
} else if (ev == null || ev != null && (ev.getAction() == MotionEvent.ACTION_CANCEL || ev.getAction() == MotionEvent.ACTION_UP)) {
|
||||||
maybeStartTracking = false;
|
maybeStartTracking = false;
|
||||||
startedTracking = false;
|
startedTracking = false;
|
||||||
if (velocityTracker != null) {
|
if (velocityTracker != null) {
|
||||||
|
|
Loading…
Reference in a new issue