mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 16:19:33 +01:00
@@ -392,7 +392,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_call_secure:
|
||||
case R.id.menu_call_insecure: handleDial(getRecipients().getPrimaryRecipient()); return true;
|
||||
case R.id.menu_delete_thread: handleDeleteThread(); return true;
|
||||
case R.id.menu_add_attachment: handleAddAttachment(); return true;
|
||||
case R.id.menu_view_media: handleViewMedia(); return true;
|
||||
case R.id.menu_add_to_contacts: handleAddToContacts(); return true;
|
||||
@@ -650,28 +649,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
new GroupMembersDialog(this, getRecipients()).display();
|
||||
}
|
||||
|
||||
private void handleDeleteThread() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.ConversationActivity_delete_thread_question);
|
||||
builder.setIconAttribute(R.attr.dialog_alert_icon);
|
||||
builder.setCancelable(true);
|
||||
builder.setMessage(R.string.ConversationActivity_this_will_permanently_delete_all_messages_in_this_conversation);
|
||||
builder.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (threadId > 0) {
|
||||
DatabaseFactory.getThreadDatabase(ConversationActivity.this).deleteConversation(threadId);
|
||||
}
|
||||
composeText.getText().clear();
|
||||
threadId = -1;
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private void handleAddToContacts() {
|
||||
final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
|
||||
intent.putExtra(ContactsContract.Intents.Insert.PHONE, recipients.getPrimaryRecipient().getNumber());
|
||||
@@ -1089,9 +1066,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
draftDatabase.insertDrafts(new MasterCipher(thisMasterSecret), threadId, drafts);
|
||||
threadDatabase.updateSnippet(threadId, drafts.getSnippet(ConversationActivity.this),
|
||||
drafts.getUriSnippet(ConversationActivity.this),
|
||||
System.currentTimeMillis(), Types.BASE_DRAFT_TYPE);
|
||||
System.currentTimeMillis(), Types.BASE_DRAFT_TYPE, true);
|
||||
} else if (threadId > 0) {
|
||||
threadDatabase.update(threadId);
|
||||
threadDatabase.update(threadId, false);
|
||||
}
|
||||
|
||||
return threadId;
|
||||
|
||||
Reference in New Issue
Block a user