Fixed bug with new message in non-existing chat (in Dialog list)

This commit is contained in:
ChronosX88 2019-05-25 12:38:25 +04:00
parent 33a8289177
commit 82bd46f306

View File

@ -124,7 +124,7 @@ public class DialogListPresenter implements CoreContracts.IDialogListPresenterCo
dialogListAdapter.upsertItem(new GenericDialog(LocalDBWrapper.getChatByChatID(event.chatID))); dialogListAdapter.upsertItem(new GenericDialog(LocalDBWrapper.getChatByChatID(event.chatID)));
} }
@Subscribe @Subscribe(threadMode = ThreadMode.MAIN)
public void onNewMessage(NewMessageEvent event) { public void onNewMessage(NewMessageEvent event) {
String chatID = event.chatID; String chatID = event.chatID;
GenericDialog dialog = dialogListAdapter.getItemById(chatID); GenericDialog dialog = dialogListAdapter.getItemById(chatID);
@ -154,6 +154,7 @@ public class DialogListPresenter implements CoreContracts.IDialogListPresenterCo
dialog.setLastMessage(new GenericMessage(messageEntity)); dialog.setLastMessage(new GenericMessage(messageEntity));
} }
dialogListAdapter.upsertItem(dialog); dialogListAdapter.upsertItem(dialog);
dialogListAdapter.notifyDataSetChanged();
}); });
} }
}); });