removed unused paramater 'newTask' from switchToConversation api

This commit is contained in:
Daniel Gultsch 2018-10-19 15:18:36 +02:00
parent 5e764216ef
commit 71bbd379e9
3 changed files with 12 additions and 31 deletions

View File

@ -56,7 +56,7 @@ public class ShareViaAccountActivity extends XmppActivity {
final Jid contact = Jid.of(getIntent().getStringExtra(EXTRA_CONTACT)); final Jid contact = Jid.of(getIntent().getStringExtra(EXTRA_CONTACT));
final Conversation conversation = xmppConnectionService.findOrCreateConversation( final Conversation conversation = xmppConnectionService.findOrCreateConversation(
account, contact, false, false); account, contact, false, false);
switchToConversation(conversation, body, false); switchToConversation(conversation, body);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
// ignore error // ignore error
} }
@ -86,7 +86,7 @@ public class ShareViaAccountActivity extends XmppActivity {
final Jid contact = Jid.of(getIntent().getStringExtra(EXTRA_CONTACT)); final Jid contact = Jid.of(getIntent().getStringExtra(EXTRA_CONTACT));
final Conversation conversation = xmppConnectionService.findOrCreateConversation( final Conversation conversation = xmppConnectionService.findOrCreateConversation(
account, contact, false, false); account, contact, false, false);
switchToConversation(conversation, body, false); switchToConversation(conversation, body);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
// ignore error // ignore error
} }

View File

@ -547,7 +547,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
Conversation conversation = xmppConnectionService Conversation conversation = xmppConnectionService
.findOrCreateConversation(contact.getAccount(), .findOrCreateConversation(contact.getAccount(),
contact.getJid(), false, true); contact.getJid(), false, true);
switchToConversation(conversation, body, false); switchToConversation(conversation, body);
} }
@Override @Override
@ -777,7 +777,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
if (invite.isAction(XmppUri.ACTION_JOIN)) { if (invite.isAction(XmppUri.ACTION_JOIN)) {
Conversation muc = xmppConnectionService.findFirstMuc(invite.getJid()); Conversation muc = xmppConnectionService.findFirstMuc(invite.getJid());
if (muc != null) { if (muc != null) {
switchToConversation(muc, invite.getBody(), false); switchToConversation(muc, invite.getBody());
return true; return true;
} else { } else {
showJoinConferenceDialog(invite.getJid().asBareJid().toString()); showJoinConferenceDialog(invite.getJid().asBareJid().toString());

View File

@ -449,26 +449,26 @@ public abstract class XmppActivity extends ActionBarActivity {
} }
public void switchToConversation(Conversation conversation) { public void switchToConversation(Conversation conversation) {
switchToConversation(conversation, null, false); switchToConversation(conversation, null);
} }
public void switchToConversationAndQuote(Conversation conversation, String text) { public void switchToConversationAndQuote(Conversation conversation, String text) {
switchToConversation(conversation, text, true, null, false, false); switchToConversation(conversation, text, true, null, false);
} }
public void switchToConversation(Conversation conversation, String text, boolean newTask) { public void switchToConversation(Conversation conversation, String text) {
switchToConversation(conversation, text, false, null, false, newTask); switchToConversation(conversation, text, false, null, false);
} }
public void highlightInMuc(Conversation conversation, String nick) { public void highlightInMuc(Conversation conversation, String nick) {
switchToConversation(conversation, null, false, nick, false, false); switchToConversation(conversation, null, false, nick, false);
} }
public void privateMsgInMuc(Conversation conversation, String nick) { public void privateMsgInMuc(Conversation conversation, String nick) {
switchToConversation(conversation, null, false, nick, true, false); switchToConversation(conversation, null, false, nick, true);
} }
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) {
Intent intent = new Intent(this, ConversationsActivity.class); Intent intent = new Intent(this, ConversationsActivity.class);
intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION); intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION);
intent.putExtra(ConversationsActivity.EXTRA_CONVERSATION, conversation.getUuid()); intent.putExtra(ConversationsActivity.EXTRA_CONVERSATION, conversation.getUuid());
@ -482,14 +482,7 @@ public abstract class XmppActivity extends ActionBarActivity {
intent.putExtra(ConversationsActivity.EXTRA_NICK, nick); intent.putExtra(ConversationsActivity.EXTRA_NICK, nick);
intent.putExtra(ConversationsActivity.EXTRA_IS_PRIVATE_MESSAGE, pm); intent.putExtra(ConversationsActivity.EXTRA_IS_PRIVATE_MESSAGE, pm);
} }
if (newTask) { intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setFlags(intent.getFlags()
| Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
} else {
intent.setFlags(intent.getFlags()
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
}
startActivity(intent); startActivity(intent);
finish(); finish();
} }
@ -598,18 +591,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") @SuppressWarnings("deprecation")
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
protected void setListItemBackgroundOnView(View view) { protected void setListItemBackgroundOnView(View view) {