diff options
author | Christian S <christian@pix-art.de> | 2016-04-11 19:49:20 +0200 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2016-04-11 19:49:20 +0200 |
commit | ec870c793a3429519cc42971c45a446d946f1dd4 (patch) | |
tree | 91da7f06512980b59634fc8afdb5f909c1051648 | |
parent | c49859529cde662c1272c0bc1f8ae8a0004f5f4d (diff) |
don't show contact details when in conversations with self
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 868835da8..ea3cf627a 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -98,11 +98,10 @@ public class ConversationActivity extends XmppActivity private static final String STATE_OPEN_CONVERSATION = "state_open_conversation"; private static final String STATE_PANEL_OPEN = "state_panel_open"; private static final String STATE_PENDING_URI = "state_pending_uri"; - - private String mOpenConverstaion = null; - private boolean mPanelOpen = true; final private List<Uri> mPendingImageUris = new ArrayList<>(); final private List<Uri> mPendingFileUris = new ArrayList<>(); + private String mOpenConverstaion = null; + private boolean mPanelOpen = true; private Uri mPendingGeoUri = null; private boolean forbidProcessingPendings = false; private Message mPendingDownloadableMessage = null; @@ -123,6 +122,24 @@ public class ConversationActivity extends XmppActivity private AtomicBoolean mRedirected = new AtomicBoolean(false); private Pair<Integer, Intent> mPostponedActivityResult; + @SuppressLint("NewApi") + private static List<Uri> extractUriFromIntent(final Intent intent) { + List<Uri> uris = new ArrayList<>(); + if (intent == null) { + return uris; + } + Uri uri = intent.getData(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && uri == null) { + ClipData clipData = intent.getClipData(); + for (int i = 0; i < clipData.getItemCount(); ++i) { + uris.add(clipData.getItemAt(i).getUri()); + } + } else { + uris.add(uri); + } + return uris; + } + public Conversation getSelectedConversation() { return this.mSelectedConversation; } @@ -383,7 +400,7 @@ public class ConversationActivity extends XmppActivity TextView abtitle = (TextView) findViewById(android.R.id.text1); abtitle.setText(conversation.getName()); abtitle.setOnClickListener(this); - if (conversation.getMode() == Conversation.MODE_SINGLE) { + if (conversation.getMode() == Conversation.MODE_SINGLE && !this.getSelectedConversation().withSelf()) { if (conversation.getContact().getMostAvailableStatus() == Presence.Status.OFFLINE) { TextView absubtitle = (TextView) findViewById(android.R.id.text2); absubtitle.setText(getString(R.string.account_status_offline)); @@ -424,8 +441,8 @@ public class ConversationActivity extends XmppActivity absubtitle.setOnClickListener(this); } } else { - ab.setDisplayHomeAsUpEnabled(false); - ab.setHomeButtonEnabled(false); + ab.setDisplayHomeAsUpEnabled(false); + ab.setHomeButtonEnabled(false); ab.setDisplayShowTitleEnabled(true); ab.setDisplayShowCustomEnabled(false); ab.setTitle(R.string.app_name); @@ -490,8 +507,6 @@ public class ConversationActivity extends XmppActivity menuInviteContact.setVisible(getSelectedConversation().getMucOptions().canInvite()); menuSecure.setVisible((Config.supportOpenPgp() || Config.supportOmemo()) && Config.multipleEncryptionChoices()); //only if pgp is supported we have a choice } else { - menuContactDetails.setVisible(!this.getSelectedConversation().withSelf()); - menuMucDetails.setVisible(false); menuSecure.setVisible(Config.multipleEncryptionChoices()); } if (this.getSelectedConversation().isMuted()) { @@ -1327,24 +1342,6 @@ public class ConversationActivity extends XmppActivity xmppConnectionService.getNotificationService().setOpenConversation(null); } - @SuppressLint("NewApi") - private static List<Uri> extractUriFromIntent(final Intent intent) { - List<Uri> uris = new ArrayList<>(); - if (intent == null) { - return uris; - } - Uri uri = intent.getData(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && uri == null) { - ClipData clipData = intent.getClipData(); - for (int i = 0; i < clipData.getItemCount(); ++i) { - uris.add(clipData.getItemAt(i).getUri()); - } - } else { - uris.add(uri); - } - return uris; - } - @Override protected void onActivityResult(int requestCode, int resultCode, final Intent data) { super.onActivityResult(requestCode, resultCode, data); |