mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 10:43:39 +00:00
Disable input bar for RSS feeds
This commit is contained in:
parent
fb8104cd18
commit
386b219076
@ -2131,6 +2131,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateInputPanel() {
|
private void updateInputPanel() {
|
||||||
|
Recipient recipient = DatabaseFactory.getThreadDatabase(this).getRecipientForThreadId(threadId);
|
||||||
|
boolean isGroup = recipient.isGroupRecipient();
|
||||||
|
if (isGroup) {
|
||||||
|
boolean isRSSFeed = recipient.getName().equals("Loki News") || recipient.getName().equals("Loki Messenger Updates"); // TODO: This is just a temporary hack and should be removed ASAP
|
||||||
|
inputPanel.setEnabled(!isRSSFeed);
|
||||||
|
String hint = isRSSFeed ? "Input disabled" : "New Message";
|
||||||
|
inputPanel.setHint(hint);
|
||||||
|
} else {
|
||||||
boolean hasPendingFriendRequest = DatabaseFactory.getLokiThreadDatabase(this).hasPendingFriendRequest(threadId);
|
boolean hasPendingFriendRequest = DatabaseFactory.getLokiThreadDatabase(this).hasPendingFriendRequest(threadId);
|
||||||
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;
|
||||||
@ -2141,6 +2149,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
inputMethodManager.showSoftInput(inputPanel.composeText, 0);
|
inputMethodManager.showSoftInput(inputPanel.composeText, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void sendMessage() {
|
private void sendMessage() {
|
||||||
if (inputPanel.isRecordingInLockedMode()) {
|
if (inputPanel.isRecordingInLockedMode()) {
|
||||||
@ -2189,8 +2198,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
Log.w(TAG, ex);
|
Log.w(TAG, ex);
|
||||||
} catch (InvalidMessageException ex) {
|
} catch (InvalidMessageException ex) {
|
||||||
Toast.makeText(ConversationActivity.this, R.string.ConversationActivity_message_is_empty_exclamation,
|
// Toast.makeText(ConversationActivity.this, R.string.ConversationActivity_message_is_empty_exclamation,
|
||||||
Toast.LENGTH_SHORT).show();
|
// Toast.LENGTH_SHORT).show();
|
||||||
Log.w(TAG, ex);
|
Log.w(TAG, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user