fix to load conversations when servers status app is disabled

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-05-03 10:56:33 +02:00
parent eb57411bbd
commit 7f2b337565
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
2 changed files with 9 additions and 5 deletions

View file

@ -202,11 +202,11 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
holder.binding.favoriteConversationImageView.setVisibility(View.GONE);
}
if (Conversation.ConversationType.ROOM_SYSTEM != conversation.getType()) {
if (status != null && Conversation.ConversationType.ROOM_SYSTEM != conversation.getType()) {
float size = DisplayUtils.convertDpToPixel(STATUS_SIZE_IN_DP, appContext);
holder.binding.userStatusImage.setImageDrawable(new StatusDrawable(
status != null ? status.getStatus() : "",
status != null ? status.getIcon() : "",
status.getStatus(),
status.getIcon(),
size,
context.getResources().getColor(R.color.bg_default),
appContext));

View file

@ -472,10 +472,14 @@ public class ConversationsListController extends BaseController implements Searc
@SuppressLint("LongLogTag")
public void fetchData() {
fetchUserStatuses();
if (CapabilitiesUtil.isUserStatusAvailable(userUtils.getCurrentUser())) {
fetchUserStatusesAndRooms();
} else {
fetchRooms();
}
}
private void fetchUserStatuses() {
private void fetchUserStatusesAndRooms() {
ncApi.getUserStatuses(credentials, ApiUtils.getUrlForUserStatuses(currentUser.getBaseUrl()))
.subscribe(new Observer<StatusesOverall>() {
@Override