|
|
@ -148,6 +148,10 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
private static final int PICK_CONTACT_INFO = 5;
|
|
|
|
private static final int PICK_CONTACT_INFO = 5;
|
|
|
|
private static final int GROUP_EDIT = 6;
|
|
|
|
private static final int GROUP_EDIT = 6;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final int SEND_ATTRIBUTES[] = new int[]{R.attr.conversation_send_button_push,
|
|
|
|
|
|
|
|
R.attr.conversation_send_button_sms_secure,
|
|
|
|
|
|
|
|
R.attr.conversation_send_button_sms_insecure};
|
|
|
|
|
|
|
|
|
|
|
|
private MasterSecret masterSecret;
|
|
|
|
private MasterSecret masterSecret;
|
|
|
|
private RecipientsPanel recipientsPanel;
|
|
|
|
private RecipientsPanel recipientsPanel;
|
|
|
|
private EditText composeText;
|
|
|
|
private EditText composeText;
|
|
|
@ -673,26 +677,31 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeSecurity() {
|
|
|
|
private void initializeSecurity() {
|
|
|
|
int attributes[] = new int[]{R.attr.conversation_send_button,
|
|
|
|
|
|
|
|
R.attr.conversation_send_secure_button};
|
|
|
|
|
|
|
|
TypedArray drawables = obtainStyledAttributes(attributes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isPushDestination() || (getRecipients() != null && getRecipients().isGroupRecipient()) ||
|
|
|
|
TypedArray drawables = obtainStyledAttributes(SEND_ATTRIBUTES);
|
|
|
|
|
|
|
|
if ((getRecipients() != null && getRecipients().isGroupRecipient()) ||
|
|
|
|
(isSingleConversation() && Session.hasSession(this, masterSecret, getRecipients().getPrimaryRecipient())))
|
|
|
|
(isSingleConversation() && Session.hasSession(this, masterSecret, getRecipients().getPrimaryRecipient())))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sendButton.setImageDrawable(drawables.getDrawable(1));
|
|
|
|
|
|
|
|
this.isEncryptedConversation = true;
|
|
|
|
this.isEncryptedConversation = true;
|
|
|
|
this.isAuthenticatedConversation = Session.hasRemoteIdentityKey(this, masterSecret, getRecipients().getPrimaryRecipient());
|
|
|
|
this.isAuthenticatedConversation = Session.hasRemoteIdentityKey(this, masterSecret, getRecipients().getPrimaryRecipient());
|
|
|
|
this.characterCalculator = new EncryptedCharacterCalculator();
|
|
|
|
this.characterCalculator = new EncryptedCharacterCalculator();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
sendButton.setImageDrawable(drawables.getDrawable(0));
|
|
|
|
|
|
|
|
this.isEncryptedConversation = false;
|
|
|
|
this.isEncryptedConversation = false;
|
|
|
|
this.isAuthenticatedConversation = false;
|
|
|
|
this.isAuthenticatedConversation = false;
|
|
|
|
this.characterCalculator = new CharacterCalculator();
|
|
|
|
this.characterCalculator = new CharacterCalculator();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
calculateCharactersRemaining();
|
|
|
|
if (isPushDestination()) {
|
|
|
|
|
|
|
|
sendButton.setImageDrawable(drawables.getDrawable(0));
|
|
|
|
|
|
|
|
} else if (isEncryptedConversation) {
|
|
|
|
|
|
|
|
sendButton.setImageDrawable(drawables.getDrawable(1));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
sendButton.setImageDrawable(drawables.getDrawable(2));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
drawables.recycle();
|
|
|
|
drawables.recycle();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
calculateCharactersRemaining();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeMmsEnabledCheck() {
|
|
|
|
private void initializeMmsEnabledCheck() {
|
|
|
@ -769,6 +778,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
composeText.setText(getString(R.string.ConversationActivity_forward_message_prefix) + ": " +
|
|
|
|
composeText.setText(getString(R.string.ConversationActivity_forward_message_prefix) + ": " +
|
|
|
|
getIntent().getStringExtra("forwarded_message"));
|
|
|
|
getIntent().getStringExtra("forwarded_message"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeRecipientsInput() {
|
|
|
|
private void initializeRecipientsInput() {
|
|
|
@ -1200,7 +1210,6 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1214,15 +1223,6 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
|
calculateCharactersRemaining();
|
|
|
|
calculateCharactersRemaining();
|
|
|
|
// if (s == null || s.length() == 0) {
|
|
|
|
|
|
|
|
// sendButton.setClickable(false);
|
|
|
|
|
|
|
|
// sendButton.setEnabled(false);
|
|
|
|
|
|
|
|
// sendButton.setColorFilter(0x66FFFFFF);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// sendButton.setClickable(true);
|
|
|
|
|
|
|
|
// sendButton.setEnabled(true);
|
|
|
|
|
|
|
|
// sendButton.setColorFilter(null);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count,int after) {}
|
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count,int after) {}
|
|
|
|