diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/XmppActivity.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/XmppActivity.java | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index d01f29ac5..dcf3afed4 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -447,15 +447,19 @@ public abstract class XmppActivity extends ActionBarActivity { } public void switchToConversation(Conversation conversation) { - switchToConversation(conversation, null, false); + switchToConversation(conversation, null); } public void switchToConversationAndQuote(Conversation conversation, String text) { switchToConversation(conversation, text, true, null, false, false); } - public void switchToConversation(Conversation conversation, String text, boolean newTask) { - switchToConversation(conversation, text, false, null, false, newTask); + public void switchToConversation(Conversation conversation, String text) { + switchToConversation(conversation, text, false, null, false, false); + } + + public void switchToConversationDoNotAppend(Conversation conversation, String text) { + switchToConversation(conversation, text, false, null, false, true); } public void highlightInMuc(Conversation conversation, String nick) { @@ -466,7 +470,7 @@ public abstract class XmppActivity extends ActionBarActivity { switchToConversation(conversation, null, false, nick, true, false); } - private void switchToConversation(Conversation conversation, String text, boolean asQuote, String nick, boolean pm, boolean newTask) { + private void switchToConversation(Conversation conversation, String text, boolean asQuote, String nick, boolean pm, boolean doNotAppend) { Intent intent = new Intent(this, ConversationsActivity.class); intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION); intent.putExtra(ConversationsActivity.EXTRA_CONVERSATION, conversation.getUuid()); @@ -480,13 +484,10 @@ public abstract class XmppActivity extends ActionBarActivity { intent.putExtra(ConversationsActivity.EXTRA_NICK, nick); intent.putExtra(ConversationsActivity.EXTRA_IS_PRIVATE_MESSAGE, pm); } - if (newTask) { - intent.setFlags(intent.getFlags() - | Intent.FLAG_ACTIVITY_NEW_TASK - | Intent.FLAG_ACTIVITY_SINGLE_TOP); - } else { - intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_CLEAR_TOP); + if (doNotAppend) { + intent.putExtra(ConversationsActivity.EXTRA_DO_NOT_APPEND, true); } + intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); overridePendingTransition(R.animator.fade_in, R.animator.fade_out); finish(); @@ -598,18 +599,6 @@ public abstract class XmppActivity extends ActionBarActivity { } } - protected boolean noAccountUsesPgp() { - if (!hasPgp()) { - return true; - } - for (Account account : xmppConnectionService.getAccounts()) { - if (account.getPgpId() != 0) { - return false; - } - } - return true; - } - @SuppressWarnings("deprecation") @TargetApi(Build.VERSION_CODES.JELLY_BEAN) protected void setListItemBackgroundOnView(View view) { |