use inContactList() instead inRoster() in the proper places

This commit is contained in:
Daniel Gultsch 2018-11-03 16:32:08 +01:00
parent 4a35c3c7cf
commit f0d5dc583d
6 changed files with 9 additions and 11 deletions

View File

@ -15,8 +15,6 @@ import java.util.Set;
import eu.siacs.conversations.Config; import eu.siacs.conversations.Config;
import eu.siacs.conversations.crypto.axolotl.FingerprintStatus; import eu.siacs.conversations.crypto.axolotl.FingerprintStatus;
import eu.siacs.conversations.http.AesGcmURLStreamHandler;
import eu.siacs.conversations.ui.adapter.MessageAdapter;
import eu.siacs.conversations.utils.CryptoHelper; import eu.siacs.conversations.utils.CryptoHelper;
import eu.siacs.conversations.utils.Emoticons; import eu.siacs.conversations.utils.Emoticons;
import eu.siacs.conversations.utils.GeoHelper; import eu.siacs.conversations.utils.GeoHelper;
@ -290,7 +288,7 @@ public class Message extends AbstractEntity {
return null; return null;
} else { } else {
return this.conversation.getAccount().getRoster() return this.conversation.getAccount().getRoster()
.getContactFromRoster(this.trueCounterpart); .getContactFromContactList(this.trueCounterpart);
} }
} }
} }

View File

@ -719,7 +719,7 @@ public class MucOptions {
public Contact getContact() { public Contact getContact() {
if (fullJid != null) { if (fullJid != null) {
return getAccount().getRoster().getContactFromRoster(realJid); return getAccount().getRoster().getContactFromContactList(realJid);
} else if (realJid != null) { } else if (realJid != null) {
return getAccount().getRoster().getContact(realJid); return getAccount().getRoster().getContact(realJid);
} else { } else {

View File

@ -10,21 +10,21 @@ import rocks.xmpp.addr.Jid;
public class Roster { public class Roster {
final Account account; private final Account account;
final HashMap<Jid, Contact> contacts = new HashMap<>(); private final HashMap<Jid, Contact> contacts = new HashMap<>();
private String version = null; private String version = null;
public Roster(Account account) { public Roster(Account account) {
this.account = account; this.account = account;
} }
public Contact getContactFromRoster(Jid jid) { public Contact getContactFromContactList(Jid jid) {
if (jid == null) { if (jid == null) {
return null; return null;
} }
synchronized (this.contacts) { synchronized (this.contacts) {
Contact contact = contacts.get(jid.asBareJid()); Contact contact = contacts.get(jid.asBareJid());
if (contact != null && contact.showInRoster()) { if (contact != null && contact.showInContactList()) {
return contact; return contact;
} else { } else {
return null; return null;

View File

@ -3685,7 +3685,7 @@ public class XmppConnectionService extends Service {
for (Account account : getAccounts()) { for (Account account : getAccounts()) {
if ((account.isEnabled() || accountJid != null) if ((account.isEnabled() || accountJid != null)
&& (accountJid == null || accountJid.equals(account.getJid().asBareJid().toString()))) { && (accountJid == null || accountJid.equals(account.getJid().asBareJid().toString()))) {
Contact contact = account.getRoster().getContactFromRoster(jid); Contact contact = account.getRoster().getContactFromContactList(jid);
if (contact != null) { if (contact != null) {
contacts.add(contact); contacts.add(contact);
} }

View File

@ -433,7 +433,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
this.mSelectedUser = user; this.mSelectedUser = user;
String name; String name;
final Contact contact = user.getContact(); final Contact contact = user.getContact();
if (contact != null && contact.showInRoster()) { if (contact != null && contact.showInContactList()) {
name = contact.getDisplayName(); name = contact.getDisplayName();
} else if (user.getRealJid() != null) { } else if (user.getRealJid() != null) {
name = user.getRealJid().asBareJid().toString(); name = user.getRealJid().asBareJid().toString();

View File

@ -55,7 +55,7 @@ public class ShortcutActivity extends AbstractSearchableListItemActivity{
for (final Account account : xmppConnectionService.getAccounts()) { for (final Account account : xmppConnectionService.getAccounts()) {
if (account.getStatus() != Account.State.DISABLED) { if (account.getStatus() != Account.State.DISABLED) {
for (final Contact contact : account.getRoster().getContacts()) { for (final Contact contact : account.getRoster().getContacts()) {
if (contact.showInRoster() if (contact.showInContactList()
&& contact.match(this, needle)) { && contact.match(this, needle)) {
getListItems().add(contact); getListItems().add(contact);
} }