fix wired 'Hide offline' behavior

This commit is contained in:
kosyak 2024-08-05 21:19:52 +02:00
parent 1fa72c42a0
commit 2b2ecbb44e

View file

@ -847,12 +847,22 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
filter(mSearchEditText.getText().toString()); filter(mSearchEditText.getText().toString());
} }
invalidateOptionsMenu(); invalidateOptionsMenu();
return true;
case R.id.action_note_to_self: case R.id.action_note_to_self:
if (xmppConnectionService == null) {
return true;
}
final List<Account> accounts = xmppConnectionService.getAccounts(); final List<Account> accounts = xmppConnectionService.getAccounts();
if (accounts.size() == 1) { if (accounts.size() == 1) {
if (accounts.get(0).getSelfContact() == null) {
return true;
}
final Contact self = new Contact(accounts.get(0).getSelfContact()); final Contact self = new Contact(accounts.get(0).getSelfContact());
openConversationForContact(self); openConversationForContact(self);
} }
return true;
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }