Merge pull request #1482 from nextcloud/removeHardcodedApiForLocationSharing

remove hardcoded api version for location sharing
This commit is contained in:
Andy Scherzinger 2021-07-15 20:30:02 +02:00 committed by GitHub
commit e0ecf049b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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";
}
}