mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-28 17:38:55 +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\"," +
|
"{\"type\":\"geo-location\",\"id\":\"geo:$selectedLat,$selectedLon\",\"latitude\":\"$selectedLat\"," +
|
||||||
"\"longitude\":\"$selectedLon\",\"name\":\"$locationNameToShare\"}"
|
"\"longitude\":\"$selectedLon\",\"name\":\"$locationNameToShare\"}"
|
||||||
|
|
||||||
|
val apiVersion = ApiUtils.getChatApiVersion(userUtils.currentUser, intArrayOf(1))
|
||||||
|
|
||||||
ncApi.sendLocation(
|
ncApi.sendLocation(
|
||||||
ApiUtils.getCredentials(userUtils.currentUser?.username, userUtils.currentUser?.token),
|
ApiUtils.getCredentials(userUtils.currentUser?.username, userUtils.currentUser?.token),
|
||||||
ApiUtils.getUrlToSendLocation(userUtils.currentUser?.baseUrl, roomToken),
|
ApiUtils.getUrlToSendLocation(apiVersion, userUtils.currentUser?.baseUrl, roomToken),
|
||||||
"geo-location",
|
"geo-location",
|
||||||
objectId,
|
objectId,
|
||||||
metaData
|
metaData
|
||||||
|
|
|
@ -391,7 +391,7 @@ public class ApiUtils {
|
||||||
return baseUrl + ocsApiVersion + "/cloud/user/fields";
|
return baseUrl + ocsApiVersion + "/cloud/user/fields";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getUrlToSendLocation(String baseUrl, String roomToken) {
|
public static String getUrlToSendLocation(int version, String baseUrl, String roomToken) {
|
||||||
return baseUrl + ocsApiVersion + "/apps/spreed/api/v1/chat/" + roomToken + "/share";
|
return getUrlForChat(version, baseUrl, roomToken) + "/share";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue