aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-11-23 12:46:02 +0100
committerChristian Schneppe <christian@pix-art.de>2018-11-23 12:46:02 +0100
commit0a3d6bc6d002c3daa20140cdbe4c285cda37fd98 (patch)
tree83c64b2fea3762198e0abd8c14d2deba1b5af55b /src/main/java
parentf7fea5a35adae306326de57da22420c52bfc4517 (diff)
show synced contacts in choose contact activity
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/Config.java2
-rw-r--r--src/main/java/de/pixart/messenger/entities/Contact.java7
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java3
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java3
6 files changed, 6 insertions, 13 deletions
diff --git a/src/main/java/de/pixart/messenger/Config.java b/src/main/java/de/pixart/messenger/Config.java
index 13c86e6a1..d79f8ca64 100644
--- a/src/main/java/de/pixart/messenger/Config.java
+++ b/src/main/java/de/pixart/messenger/Config.java
@@ -60,8 +60,6 @@ public final class Config {
public static final boolean FORCE_ORBOT = false; // always use TOR
- public static final long CONTACT_SYNC_RETRY_INTERVAL = 1000L * 60 * 5;
-
public static final boolean HIDE_MESSAGE_TEXT_IN_NOTIFICATION = false;
public static final boolean SHOW_CONNECTED_ACCOUNTS = false; //show number of connected accounts in foreground notification
diff --git a/src/main/java/de/pixart/messenger/entities/Contact.java b/src/main/java/de/pixart/messenger/entities/Contact.java
index 17a6b1099..1df6e120a 100644
--- a/src/main/java/de/pixart/messenger/entities/Contact.java
+++ b/src/main/java/de/pixart/messenger/entities/Contact.java
@@ -166,9 +166,6 @@ public class Contact implements ListItem, Blockable {
if (isBlocked()) {
tags.add(new Tag(context.getString(R.string.blocked), 0xff2e2f3b, 0));
}
- if (showInPhoneBook()) {
- tags.add(new Tag(context.getString(R.string.phone_book), 0xFF1E88E5, 0));
- }
return tags;
}
@@ -387,8 +384,8 @@ public class Contact implements ListItem, Blockable {
|| (this.getOption(Contact.Options.DIRTY_PUSH));
}
- public boolean showInPhoneBook() {
- return systemAccount != null;
+ public boolean showInContactList() {
+ return showInRoster() || getOption(Options.SYNCED_VIA_OTHER);
}
public void parseSubscriptionFromElement(Element item) {
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index db6006ca3..4dcd79e9d 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -1147,9 +1147,8 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
final Contact contact = getContact();
return mode == MODE_SINGLE
&& !contact.isOwnServer()
- && !contact.showInRoster()
+ && !contact.showInContactList()
&& !contact.isSelf()
- && !contact.showInPhoneBook()
&& sentMessagesCount() == 0;
}
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 14d235553..730e67170 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -673,7 +673,7 @@ public class Message extends AbstractEntity {
public boolean trusted() {
Contact contact = this.getContact();
- return status > STATUS_RECEIVED || (contact != null && (contact.showInRoster() || contact.isSelf()));
+ return status > STATUS_RECEIVED || (contact != null && (contact.showInContactList() || contact.isSelf()));
}
public boolean fixCounterpart() {
diff --git a/src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java b/src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java
index a760a563b..ac1866fec 100644
--- a/src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java
@@ -263,7 +263,7 @@ public class ChooseContactActivity extends AbstractSearchableListItemActivity im
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() &&
!filterContacts.contains(contact.getJid().asBareJid().toString())
&& contact.match(this, needle)) {
getListItems().add(contact);
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index 171db1bda..462fb4429 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -869,12 +869,11 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
protected void filterContacts(String needle) {
this.contacts.clear();
final List<Account> accounts = xmppConnectionService.getAccounts();
- final boolean singleAccountActive = isSingleAccountActive(accounts);
for (Account account : accounts) {
if (account.getStatus() != Account.State.DISABLED) {
for (Contact contact : account.getRoster().getContacts()) {
Presence.Status s = contact.getShownStatus();
- if ((contact.showInRoster() || (singleAccountActive && contact.showInPhoneBook())) && contact.match(this, needle)
+ if (contact.showInContactList() && contact.match(this, needle)
&& (!this.mHideOfflineContacts
|| (needle != null && !needle.trim().isEmpty())
|| s.compareTo(Presence.Status.OFFLINE) < 0)) {