mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Disable attachments on non-friends.
This commit is contained in:
parent
8d6094ecd6
commit
b12e6b838c
@ -127,7 +127,8 @@
|
|||||||
android:paddingStart="6dp"
|
android:paddingStart="6dp"
|
||||||
android:paddingEnd="6dp"
|
android:paddingEnd="6dp"
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_toggle_camera_description" />
|
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_toggle_camera_description"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.MicrophoneRecorderView
|
<org.thoughtcrime.securesms.components.MicrophoneRecorderView
|
||||||
android:id="@+id/recorder_view"
|
android:id="@+id/recorder_view"
|
||||||
|
@ -2189,6 +2189,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
private void updateInputPanel() {
|
private void updateInputPanel() {
|
||||||
boolean hasPendingFriendRequest = !recipient.isGroupRecipient() && DatabaseFactory.getLokiThreadDatabase(this).hasPendingFriendRequest(threadId);
|
boolean hasPendingFriendRequest = !recipient.isGroupRecipient() && DatabaseFactory.getLokiThreadDatabase(this).hasPendingFriendRequest(threadId);
|
||||||
|
updateToggleButtonState();
|
||||||
inputPanel.setEnabled(!hasPendingFriendRequest);
|
inputPanel.setEnabled(!hasPendingFriendRequest);
|
||||||
int hintID = hasPendingFriendRequest ? R.string.activity_conversation_pending_friend_request_hint : R.string.activity_conversation_default_hint;
|
int hintID = hasPendingFriendRequest ? R.string.activity_conversation_pending_friend_request_hint : R.string.activity_conversation_default_hint;
|
||||||
inputPanel.setHint(getResources().getString(hintID));
|
inputPanel.setHint(getResources().getString(hintID));
|
||||||
@ -2400,6 +2401,15 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateToggleButtonState() {
|
private void updateToggleButtonState() {
|
||||||
|
// Don't allow attachments if we're not friends
|
||||||
|
LokiThreadFriendRequestStatus friendRequestStatus = DatabaseFactory.getLokiThreadDatabase(this).getFriendRequestStatus(threadId);
|
||||||
|
if (!recipient.isGroupRecipient() && friendRequestStatus != LokiThreadFriendRequestStatus.FRIENDS) {
|
||||||
|
buttonToggle.display(sendButton);
|
||||||
|
quickAttachmentToggle.hide();
|
||||||
|
inlineAttachmentToggle.hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (inputPanel.isRecordingInLockedMode()) {
|
if (inputPanel.isRecordingInLockedMode()) {
|
||||||
buttonToggle.display(sendButton);
|
buttonToggle.display(sendButton);
|
||||||
quickAttachmentToggle.show();
|
quickAttachmentToggle.show();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user