aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/Config.java3
-rw-r--r--src/main/java/de/pixart/messenger/entities/Account.java8
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java3
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java1
5 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/Config.java b/src/main/java/de/pixart/messenger/Config.java
index 5181b24b1..13c86e6a1 100644
--- a/src/main/java/de/pixart/messenger/Config.java
+++ b/src/main/java/de/pixart/messenger/Config.java
@@ -59,6 +59,9 @@ public final class Config {
public static final boolean ALLOW_NON_TLS_CONNECTIONS = false; //very dangerous. you should have a good reason to set this to true
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/Account.java b/src/main/java/de/pixart/messenger/entities/Account.java
index 9e3711535..412960e48 100644
--- a/src/main/java/de/pixart/messenger/entities/Account.java
+++ b/src/main/java/de/pixart/messenger/entities/Account.java
@@ -73,6 +73,7 @@ public class Account extends AbstractEntity {
protected String password;
protected int options = 0;
protected State status = State.OFFLINE;
+ private State lastErrorStatus = State.OFFLINE;
protected String resource;
protected String avatar;
protected String hostname = null;
@@ -271,8 +272,15 @@ public class Account extends AbstractEntity {
}
}
+ public State getLastErrorStatus() {
+ return this.lastErrorStatus;
+ }
+
public void setStatus(final State status) {
this.status = status;
+ if (status.isError) {
+ this.lastErrorStatus = status;
+ }
}
public State getTrueStatus() {
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index 053685fc6..91501f623 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -929,9 +929,10 @@ public class NotificationService {
cancel(ERROR_NOTIFICATION_ID);
return;
}
+ final boolean showAllErrors = QuickConversationsService.isConversations();
final List<Account> errors = new ArrayList<>();
for (final Account account : mXmppConnectionService.getAccounts()) {
- if (account.hasErrorStatus() && account.showErrorNotification()) {
+ if (account.hasErrorStatus() && account.showErrorNotification() && (showAllErrors || account.getLastErrorStatus() == Account.State.UNAUTHORIZED)) {
errors.add(account);
}
}
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index e9f77b33b..174785fb8 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -4041,6 +4041,10 @@ public class XmppConnectionService extends Service {
return this.mMessageArchiveService;
}
+ public QuickConversationsService getQuickConversationsService() {
+ return this.mQuickConversationsService;
+ }
+
public List<Contact> findContacts(Jid jid, String accountJid) {
ArrayList<Contact> contacts = new ArrayList<>();
for (Account account : getAccounts()) {
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index 1edbafd67..171db1bda 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -735,6 +735,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
@Override
protected void onBackendConnected() {
+ xmppConnectionService.getQuickConversationsService().considerSync();
if (mPostponedActivityResult != null) {
onActivityResult(mPostponedActivityResult.first, RESULT_OK, mPostponedActivityResult.second);
this.mPostponedActivityResult = null;