diff --git a/app/src/main/java/com/nextcloud/talk/controllers/LocationPickerController.kt b/app/src/main/java/com/nextcloud/talk/controllers/LocationPickerController.kt index c0a0bad5e..899d78296 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/LocationPickerController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/LocationPickerController.kt @@ -396,9 +396,11 @@ class LocationPickerController(args: Bundle) : "{\"type\":\"geo-location\",\"id\":\"geo:$selectedLat,$selectedLon\",\"latitude\":\"$selectedLat\"," + "\"longitude\":\"$selectedLon\",\"name\":\"$locationNameToShare\"}" + val apiVersion = ApiUtils.getChatApiVersion(userUtils.currentUser, intArrayOf(1)) + ncApi.sendLocation( ApiUtils.getCredentials(userUtils.currentUser?.username, userUtils.currentUser?.token), - ApiUtils.getUrlToSendLocation(userUtils.currentUser?.baseUrl, roomToken), + ApiUtils.getUrlToSendLocation(apiVersion, userUtils.currentUser?.baseUrl, roomToken), "geo-location", objectId, metaData diff --git a/app/src/main/java/com/nextcloud/talk/utils/ApiUtils.java b/app/src/main/java/com/nextcloud/talk/utils/ApiUtils.java index a3b19ad0c..51b7265c5 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/ApiUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/ApiUtils.java @@ -391,7 +391,7 @@ public class ApiUtils { return baseUrl + ocsApiVersion + "/cloud/user/fields"; } - public static String getUrlToSendLocation(String baseUrl, String roomToken) { - return baseUrl + ocsApiVersion + "/apps/spreed/api/v1/chat/" + roomToken + "/share"; + public static String getUrlToSendLocation(int version, String baseUrl, String roomToken) { + return getUrlForChat(version, baseUrl, roomToken) + "/share"; } }