mirror of
https://github.com/oxen-io/session-android.git
synced 2025-05-06 08:46:51 +00:00
clean up non-sense code
This commit is contained in:
parent
c5ab13aadf
commit
fcfaa32073
@ -264,7 +264,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private ImageButton attachButton;
|
private ImageButton attachButton;
|
||||||
private ProfilePictureView profilePictureView;
|
private ProfilePictureView profilePictureView;
|
||||||
private TextView titleTextView;
|
private TextView titleTextView;
|
||||||
private TextView charactersLeft;
|
|
||||||
private ConversationFragment fragment;
|
private ConversationFragment fragment;
|
||||||
private Button unblockButton;
|
private Button unblockButton;
|
||||||
private Button makeDefaultSmsButton;
|
private Button makeDefaultSmsButton;
|
||||||
@ -284,7 +283,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private AudioRecorder audioRecorder;
|
private AudioRecorder audioRecorder;
|
||||||
private Handler audioHandler;
|
private Handler audioHandler;
|
||||||
private Runnable stopRecordingTask;
|
private Runnable stopRecordingTask;
|
||||||
private BroadcastReceiver securityUpdateReceiver;
|
|
||||||
private Stub<MediaKeyboard> emojiDrawerStub;
|
private Stub<MediaKeyboard> emojiDrawerStub;
|
||||||
protected HidingLinearLayout quickAttachmentToggle;
|
protected HidingLinearLayout quickAttachmentToggle;
|
||||||
protected HidingLinearLayout inlineAttachmentToggle;
|
protected HidingLinearLayout inlineAttachmentToggle;
|
||||||
@ -296,9 +294,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private Recipient recipient;
|
private Recipient recipient;
|
||||||
private long threadId;
|
private long threadId;
|
||||||
private int distributionType;
|
private int distributionType;
|
||||||
private boolean archived;
|
|
||||||
private boolean isDefaultSms = false;
|
private boolean isDefaultSms = false;
|
||||||
private boolean isMmsEnabled = false;
|
|
||||||
private boolean isSecurityInitialized = false;
|
private boolean isSecurityInitialized = false;
|
||||||
private int expandedKeyboardHeight = 0;
|
private int expandedKeyboardHeight = 0;
|
||||||
private int collapsedKeyboardHeight = Integer.MAX_VALUE;
|
private int collapsedKeyboardHeight = Integer.MAX_VALUE;
|
||||||
@ -476,7 +472,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
initializeEnabledCheck();
|
initializeEnabledCheck();
|
||||||
initializeMmsEnabledCheck();
|
|
||||||
composeText.setTransport();
|
composeText.setTransport();
|
||||||
|
|
||||||
updateTitleTextView(recipient);
|
updateTitleTextView(recipient);
|
||||||
@ -533,7 +528,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
saveDraft();
|
saveDraft();
|
||||||
if (recipient != null) recipient.removeListener(this);
|
if (recipient != null) recipient.removeListener(this);
|
||||||
if (securityUpdateReceiver != null) unregisterReceiver(securityUpdateReceiver);
|
|
||||||
for (BroadcastReceiver broadcastReceiver : broadcastReceivers) {
|
for (BroadcastReceiver broadcastReceiver : broadcastReceivers) {
|
||||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
|
LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
|
||||||
}
|
}
|
||||||
@ -1145,7 +1139,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleAddAttachment() {
|
private void handleAddAttachment() {
|
||||||
if (this.isMmsEnabled) {
|
|
||||||
if (attachmentTypeSelector == null) {
|
if (attachmentTypeSelector == null) {
|
||||||
attachmentTypeSelector = new AttachmentTypeSelector(
|
attachmentTypeSelector = new AttachmentTypeSelector(
|
||||||
this,
|
this,
|
||||||
@ -1155,7 +1148,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
attachmentTypeSelector.show(this, attachButton);
|
attachmentTypeSelector.show(this, attachButton);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void handleSecurityChange(boolean isSecureText, boolean isDefaultSms) {
|
private void handleSecurityChange(boolean isSecureText, boolean isDefaultSms) {
|
||||||
Log.i(TAG, "handleSecurityChange(" + isSecureText + ", " + isDefaultSms + ")");
|
Log.i(TAG, "handleSecurityChange(" + isSecureText + ", " + isDefaultSms + ")");
|
||||||
@ -1340,20 +1332,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeMmsEnabledCheck() {
|
|
||||||
new AsyncTask<Void, Void, Boolean>() {
|
|
||||||
@Override
|
|
||||||
protected Boolean doInBackground(Void... params) {
|
|
||||||
return org.thoughtcrime.securesms.util.Util.isMmsCapable(ConversationActivity.this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Boolean isMmsEnabled) {
|
|
||||||
ConversationActivity.this.isMmsEnabled = isMmsEnabled;
|
|
||||||
}
|
|
||||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initializeViews() {
|
private void initializeViews() {
|
||||||
profilePictureView = findViewById(R.id.profilePictureView);
|
profilePictureView = findViewById(R.id.profilePictureView);
|
||||||
titleTextView = findViewById(R.id.titleTextView);
|
titleTextView = findViewById(R.id.titleTextView);
|
||||||
@ -1361,7 +1339,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
sendButton = ViewUtil.findById(this, R.id.send_button);
|
sendButton = ViewUtil.findById(this, R.id.send_button);
|
||||||
attachButton = ViewUtil.findById(this, R.id.attach_button);
|
attachButton = ViewUtil.findById(this, R.id.attach_button);
|
||||||
composeText = ViewUtil.findById(this, R.id.embedded_text_editor);
|
composeText = ViewUtil.findById(this, R.id.embedded_text_editor);
|
||||||
charactersLeft = ViewUtil.findById(this, R.id.space_left);
|
|
||||||
emojiDrawerStub = ViewUtil.findStubById(this, R.id.emoji_drawer_stub);
|
emojiDrawerStub = ViewUtil.findStubById(this, R.id.emoji_drawer_stub);
|
||||||
unblockButton = ViewUtil.findById(this, R.id.unblock_button);
|
unblockButton = ViewUtil.findById(this, R.id.unblock_button);
|
||||||
makeDefaultSmsButton = ViewUtil.findById(this, R.id.make_default_sms_button);
|
makeDefaultSmsButton = ViewUtil.findById(this, R.id.make_default_sms_button);
|
||||||
@ -1402,10 +1379,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
sendButton.setOnClickListener(sendButtonListener);
|
sendButton.setOnClickListener(sendButtonListener);
|
||||||
sendButton.setEnabled(true);
|
sendButton.setEnabled(true);
|
||||||
|
|
||||||
/*
|
|
||||||
titleView.setOnClickListener(v -> handleConversationSettings());
|
|
||||||
titleView.setOnLongClickListener(v -> handleDisplayQuickContact());
|
|
||||||
*/
|
|
||||||
unblockButton.setOnClickListener(v -> handleUnblock());
|
unblockButton.setOnClickListener(v -> handleUnblock());
|
||||||
makeDefaultSmsButton.setOnClickListener(v -> handleMakeDefaultSms());
|
makeDefaultSmsButton.setOnClickListener(v -> handleMakeDefaultSms());
|
||||||
|
|
||||||
@ -1447,7 +1420,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
if (address == null) { finish(); return; }
|
if (address == null) { finish(); return; }
|
||||||
recipient = Recipient.from(this, address, true);
|
recipient = Recipient.from(this, address, true);
|
||||||
threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1);
|
threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1);
|
||||||
archived = getIntent().getBooleanExtra(IS_ARCHIVED_EXTRA, false);
|
|
||||||
distributionType = getIntent().getIntExtra(DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT);
|
distributionType = getIntent().getIntExtra(DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT);
|
||||||
glideRequests = GlideApp.with(this);
|
glideRequests = GlideApp.with(this);
|
||||||
|
|
||||||
|
@ -35,30 +35,6 @@ public class IncomingMediaMessage {
|
|||||||
private final List<Contact> sharedContacts = new LinkedList<>();
|
private final List<Contact> sharedContacts = new LinkedList<>();
|
||||||
private final List<LinkPreview> linkPreviews = new LinkedList<>();
|
private final List<LinkPreview> linkPreviews = new LinkedList<>();
|
||||||
|
|
||||||
public IncomingMediaMessage(Address from,
|
|
||||||
Optional<Address> groupId,
|
|
||||||
String body,
|
|
||||||
long sentTimeMillis,
|
|
||||||
List<Attachment> attachments,
|
|
||||||
int subscriptionId,
|
|
||||||
long expiresIn,
|
|
||||||
boolean expirationUpdate,
|
|
||||||
boolean unidentified)
|
|
||||||
{
|
|
||||||
this.from = from;
|
|
||||||
this.groupId = groupId.orNull();
|
|
||||||
this.sentTimeMillis = sentTimeMillis;
|
|
||||||
this.body = body;
|
|
||||||
this.push = false;
|
|
||||||
this.subscriptionId = subscriptionId;
|
|
||||||
this.expiresIn = expiresIn;
|
|
||||||
this.expirationUpdate = expirationUpdate;
|
|
||||||
this.quote = null;
|
|
||||||
this.unidentified = unidentified;
|
|
||||||
|
|
||||||
this.attachments.addAll(attachments);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingMediaMessage(Address from,
|
public IncomingMediaMessage(Address from,
|
||||||
long sentTimeMillis,
|
long sentTimeMillis,
|
||||||
int subscriptionId,
|
int subscriptionId,
|
||||||
|
@ -66,9 +66,4 @@ public class Util {
|
|||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(VERSION_CODES.LOLLIPOP)
|
|
||||||
public static boolean isMmsCapable(Context context) {
|
|
||||||
return VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user