diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-11-23 12:58:45 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-11-23 12:58:45 +0100 |
commit | 89b2a449294d10a74e7d5f5a396ca344104f5cf6 (patch) | |
tree | 0e99e231920e29ebcc2363be3929bdb9b6813b42 /src | |
parent | 0290fa1b011c02698fc1313342ac0f8b5fd31d16 (diff) |
use inContactList() instead inRoster() in the proper places
Diffstat (limited to 'src')
6 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java index 730e67170..6d11d54d3 100644 --- a/src/main/java/de/pixart/messenger/entities/Message.java +++ b/src/main/java/de/pixart/messenger/entities/Message.java @@ -295,7 +295,7 @@ public class Message extends AbstractEntity { return null; } else { return this.conversation.getAccount().getRoster() - .getContactFromRoster(this.trueCounterpart); + .getContactFromContactList(this.trueCounterpart); } } } diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java index ec7770d77..84dcb263b 100644 --- a/src/main/java/de/pixart/messenger/entities/MucOptions.java +++ b/src/main/java/de/pixart/messenger/entities/MucOptions.java @@ -730,7 +730,7 @@ public class MucOptions { public Contact getContact() { if (fullJid != null) { - return getAccount().getRoster().getContactFromRoster(realJid); + return getAccount().getRoster().getContactFromContactList(realJid); } else if (realJid != null) { return getAccount().getRoster().getContact(realJid); } else { diff --git a/src/main/java/de/pixart/messenger/entities/Roster.java b/src/main/java/de/pixart/messenger/entities/Roster.java index fea3af1f7..13856c068 100644 --- a/src/main/java/de/pixart/messenger/entities/Roster.java +++ b/src/main/java/de/pixart/messenger/entities/Roster.java @@ -9,21 +9,21 @@ import de.pixart.messenger.android.AbstractPhoneContact; import rocks.xmpp.addr.Jid; public class Roster { - final Account account; - final HashMap<Jid, Contact> contacts = new HashMap<>(); + private final Account account; + private final HashMap<Jid, Contact> contacts = new HashMap<>(); private String version = null; public Roster(Account account) { this.account = account; } - public Contact getContactFromRoster(Jid jid) { + public Contact getContactFromContactList(Jid jid) { if (jid == null) { return null; } synchronized (this.contacts) { Contact contact = contacts.get(jid.asBareJid()); - if (contact != null && contact.showInRoster()) { + if (contact != null && contact.showInContactList()) { return contact; } else { return null; diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index bb443c375..068b3ec59 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -4053,7 +4053,7 @@ public class XmppConnectionService extends Service { for (Account account : getAccounts()) { if ((account.isEnabled() || accountJid != null) && (accountJid == null || accountJid.equals(account.getJid().asBareJid().toString()))) { - Contact contact = account.getRoster().getContactFromRoster(jid); + Contact contact = account.getRoster().getContactFromContactList(jid); if (contact != null) { contacts.add(contact); } diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 745ed67c7..fa83354c4 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -466,7 +466,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers this.mSelectedUser = user; String name; final Contact contact = user.getContact(); - if (contact != null && contact.showInRoster()) { + if (contact != null && contact.showInContactList()) { name = contact.getDisplayName(); } else if (user.getRealJid() != null) { name = user.getRealJid().asBareJid().toString(); diff --git a/src/main/java/de/pixart/messenger/ui/ShortcutActivity.java b/src/main/java/de/pixart/messenger/ui/ShortcutActivity.java index 52f87c5a3..ef5c296e0 100644 --- a/src/main/java/de/pixart/messenger/ui/ShortcutActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShortcutActivity.java @@ -55,7 +55,7 @@ public class ShortcutActivity extends AbstractSearchableListItemActivity { for (final Account account : xmppConnectionService.getAccounts()) { if (account.getStatus() != Account.State.DISABLED) { for (final Contact contact : account.getRoster().getContacts()) { - if (contact.showInRoster() + if (contact.showInContactList() && contact.match(this, needle)) { getListItems().add(contact); } |