moved avatarfetcher reset code to bind

This commit is contained in:
Daniel Gultsch 2016-03-03 13:33:02 +01:00
parent 4cb2d0ca93
commit bc5f64bffe
1 changed files with 8 additions and 8 deletions

View File

@ -254,6 +254,14 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
@Override @Override
public void onBind(final Account account) { public void onBind(final Account account) {
synchronized (mInProgressAvatarFetches) {
for (Iterator<String> iterator = mInProgressAvatarFetches.iterator(); iterator.hasNext(); ) {
final String KEY = iterator.next();
if (KEY.startsWith(account.getJid().toBareJid() + "_")) {
iterator.remove();
}
}
}
account.getRoster().clearPresences(); account.getRoster().clearPresences();
mJingleConnectionManager.cancelInTransmission(); mJingleConnectionManager.cancelInTransmission();
fetchRosterFromServer(account); fetchRosterFromServer(account);
@ -2559,14 +2567,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
account.setXmppConnection(connection); account.setXmppConnection(connection);
} }
if (!account.isOptionSet(Account.OPTION_DISABLED)) { if (!account.isOptionSet(Account.OPTION_DISABLED)) {
synchronized (this.mInProgressAvatarFetches) {
for (Iterator<String> iterator = this.mInProgressAvatarFetches.iterator(); iterator.hasNext(); ) {
final String KEY = iterator.next();
if (KEY.startsWith(account.getJid().toBareJid() + "_")) {
iterator.remove();
}
}
}
if (!force) { if (!force) {
disconnect(account, false); disconnect(account, false);
try { try {