mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-25 06:25:40 +03:00
Merge pull request #1482 from nextcloud/removeHardcodedApiForLocationSharing
remove hardcoded api version for location sharing
This commit is contained in:
commit
e0ecf049b3
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue