while restoring state deal with conversations that don't have accounts
This commit is contained in:
parent
8e0fb6a23a
commit
a55d0a691c
|
@ -1450,9 +1450,15 @@ public class XmppConnectionService extends Service {
|
|||
accountLookupTable.put(account.getUuid(), account);
|
||||
}
|
||||
this.conversations.addAll(databaseBackend.getConversations(Conversation.STATUS_AVAILABLE));
|
||||
for (Conversation conversation : this.conversations) {
|
||||
for(Iterator<Conversation> iterator = conversations.listIterator(); iterator.hasNext();) {
|
||||
Conversation conversation = iterator.next();
|
||||
Account account = accountLookupTable.get(conversation.getAccountUuid());
|
||||
if (account != null) {
|
||||
conversation.setAccount(account);
|
||||
} else {
|
||||
Log.e(Config.LOGTAG,"unable to restore Conversations with "+conversation.getJid());
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue