diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-03-31 12:15:08 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-03-31 12:15:08 +0200 |
commit | d301d25e28c1d381994d305da7f2cb14bce87333 (patch) | |
tree | 48ea53e8421e1ff7613121b37766a1242d5d85e1 /src/main | |
parent | 3b9ce9e06a75707aa8cc6e1b928078b7a91b26a9 (diff) |
add account > 0 check to inviteUser menu
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationsActivity.java | 8 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java index 009ea217e..56d347f1c 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java @@ -441,8 +441,9 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_conversations, menu); - MenuItem qrCodeScanMenuItem = menu.findItem(R.id.action_scan_qr_code); + final MenuItem qrCodeScanMenuItem = menu.findItem(R.id.action_scan_qr_code); final MenuItem menuEditProfiles = menu.findItem(R.id.action_accounts); + final MenuItem inviteUser = menu.findItem(R.id.action_invite_user); if (qrCodeScanMenuItem != null) { if (isCameraFeatureAvailable()) { Fragment fragment = getFragmentManager().findFragmentById(R.id.main_fragment); @@ -459,6 +460,11 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio } else { menuEditProfiles.setTitle(R.string.action_accounts); } + if (xmppConnectionServiceBound && xmppConnectionService.getAccounts().size() > 0) { + inviteUser.setVisible(true); + } else { + inviteUser.setVisible(false); + } return super.onCreateOptionsMenu(menu); } diff --git a/src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java b/src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java index 67cc3a9d2..f97a7074b 100644 --- a/src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java +++ b/src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java @@ -29,7 +29,6 @@ public class JoinConferenceDialog extends DialogFragment implements OnBackendCon private static final String PREFILLED_JID_KEY = "prefilled_jid"; private static final String ACCOUNTS_LIST_KEY = "activated_accounts_list"; private static final String MULTIPLE_ACCOUNTS = "multiple_accounts_enabled"; - public XmppConnectionService xmppConnectionService; private JoinConferenceDialogListener mListener; private KnownHostsAdapter knownHostsAdapter; |