From 115154331dc3c745db40c5a211213021126bb962 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 3 May 2021 16:44:55 +0200 Subject: [PATCH] Fix more java calls Signed-off-by: Joas Schilling --- .../talk/controllers/ConversationsListController.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java b/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java index 2fb61a98e..5eac81656 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java @@ -418,7 +418,15 @@ public class ConversationsListController extends BaseController implements Searc callItems = new ArrayList<>(); - roomsQueryDisposable = ncApi.getRooms(credentials, ApiUtils.getUrlForGetRooms(currentUser.getBaseUrl())) + Integer apiVersion = ApiUtils.getApiVersion(currentUser, "conversation", new int[] {4, 1}); + if (apiVersion == null) { + Log.e(TAG, "No supported API version found", new Exception("No supported API version found")); + return; + } + + + roomsQueryDisposable = ncApi.getRooms(credentials, ApiUtils.getUrlForRooms(apiVersion, + currentUser.getBaseUrl())) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(roomsOverall -> {