aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
parentf7fea5a35adae306326de57da22420c52bfc4517 (diff)
show synced contacts in choose contact activity
Diffstat (limited to 'src')
-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
-rw-r--r--src/main/res/values-fil/strings.xml2
7 files changed, 7 insertions, 14 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)) {
diff --git a/src/main/res/values-fil/strings.xml b/src/main/res/values-fil/strings.xml
index 449701f22..691e6fcf2 100644
--- a/src/main/res/values-fil/strings.xml
+++ b/src/main/res/values-fil/strings.xml
@@ -168,7 +168,7 @@
<string name="passwords_do_not_match">Ang password ay hindi magkatugma</string>
<string name="invalid_jid">Hindi ito balido na Jabber-ID</string>
<string name="error_out_of_memory">Wala ng memorya. Ang imahe ay napakalaki</string>
- <string name="add_phone_book_text">Gusto mo bang magdagdag sa iyong address book?</string>
+ <string name="add_phone_book_text">Gusto mo bang magdagdag %s sa iyong address book?</string>
<string name="server_info_show_more">Impormasyon sa server</string>
<string name="server_info_mam">XEP-0313: MAM</string>
<string name="server_info_carbon_messages">XEP-0280: Mensagheng karbon</string>