aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/crypto
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-19 10:47:27 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-19 10:47:27 +0200
commit9ce2cfa3d2e8aac80f8e73855a879baad78dad0d (patch)
tree4e5a6280daccb45e3be52b293b6fe34ce76322c1 /src/main/java/eu/siacs/conversations/crypto
parent8d595c1fc2a083046a91919d9db29915d3dfeca6 (diff)
resetting fetch status error when mutual subscription is reestablished
Diffstat (limited to 'src/main/java/eu/siacs/conversations/crypto')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
index 327a1cc84..aac814433 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -216,6 +216,20 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
private static class FetchStatusMap extends AxolotlAddressMap<FetchStatus> {
+ public void clearErrorFor(Jid jid) {
+ synchronized (MAP_LOCK) {
+ Map<Integer, FetchStatus> devices = this.map.get(jid.toBareJid().toString());
+ if (devices == null) {
+ return;
+ }
+ for(Map.Entry<Integer, FetchStatus> entry : devices.entrySet()) {
+ if (entry.getValue() == FetchStatus.ERROR) {
+ Log.d(Config.LOGTAG,"resetting error for "+jid.toBareJid()+"("+entry.getKey()+")");
+ entry.setValue(FetchStatus.TIMEOUT);
+ }
+ }
+ }
+ }
}
public static String getLogprefix(Account account) {
@@ -320,6 +334,10 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
numPublishTriesOnEmptyPep = 0;
}
+ public void clearErrorsInFetchStatusMap(Jid jid) {
+ fetchStatusMap.clearErrorFor(jid);
+ }
+
public void regenerateKeys(boolean wipeOther) {
axolotlStore.regenerate();
sessions.clear();