Skip to content
Snippets Groups Projects
Commit 6568c6a8 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

smartlist: show last interaction when syncing after importing account

When a new conversation is detected via conversationReady, load the last
messages to show it in the smartlist. Also, in smartlistviewholder,
update last interaction's visibility when needed.

Change-Id: I917e907edcb17d67dce351c2d4da741ffbe51552
GitLab: #859
parent 9739141f
No related branches found
No related tags found
No related merge requests found
...@@ -83,8 +83,10 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder { ...@@ -83,8 +83,10 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder {
binding.convLastTime.setText(lastInteractionStr); binding.convLastTime.setText(lastInteractionStr);
if (smartListViewModel.hasOngoingCall()) { if (smartListViewModel.hasOngoingCall()) {
binding.convLastItem.setVisibility(View.VISIBLE);
binding.convLastItem.setText(itemView.getContext().getString(R.string.ongoing_call)); binding.convLastItem.setText(itemView.getContext().getString(R.string.ongoing_call));
} else if (smartListViewModel.getLastEvent() != null) { } else if (smartListViewModel.getLastEvent() != null) {
binding.convLastItem.setVisibility(View.VISIBLE);
binding.convLastItem.setText(getLastEventSummary(smartListViewModel.getLastEvent(), itemView.getContext())); binding.convLastItem.setText(getLastEventSummary(smartListViewModel.getLastEvent(), itemView.getContext()));
} else { } else {
binding.convLastItem.setVisibility(View.GONE); binding.convLastItem.setVisibility(View.GONE);
......
...@@ -1639,6 +1639,7 @@ public class AccountService { ...@@ -1639,6 +1639,7 @@ public class AccountService {
} }
} }
account.conversationStarted(conversation); account.conversationStarted(conversation);
loadMore(conversation, 2);
} }
public void conversationRemoved(String accountId, String conversationId) { public void conversationRemoved(String accountId, String conversationId) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment