mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Merge pull request #1394 from nextcloud/bugfix/1393/locationNameNotNull
set locationName to "Shared location" when geocoding failed
This commit is contained in:
commit
9c00003308
@ -386,9 +386,15 @@ class LocationPickerController(args: Bundle) :
|
|||||||
|
|
||||||
private fun executeShareLocation(selectedLat: Double?, selectedLon: Double?, locationName: String?) {
|
private fun executeShareLocation(selectedLat: Double?, selectedLon: Double?, locationName: String?) {
|
||||||
val objectId = "geo:$selectedLat,$selectedLon"
|
val objectId = "geo:$selectedLat,$selectedLon"
|
||||||
|
|
||||||
|
var locationNameToShare = locationName
|
||||||
|
if (locationNameToShare.isNullOrBlank()) {
|
||||||
|
locationNameToShare = resources?.getString(R.string.nc_shared_location)
|
||||||
|
}
|
||||||
|
|
||||||
val metaData: String =
|
val metaData: String =
|
||||||
"{\"type\":\"geo-location\",\"id\":\"geo:$selectedLat,$selectedLon\",\"latitude\":\"$selectedLat\"," +
|
"{\"type\":\"geo-location\",\"id\":\"geo:$selectedLat,$selectedLon\",\"latitude\":\"$selectedLat\"," +
|
||||||
"\"longitude\":\"$selectedLon\",\"name\":\"$locationName\"}"
|
"\"longitude\":\"$selectedLon\",\"name\":\"$locationNameToShare\"}"
|
||||||
|
|
||||||
ncApi.sendLocation(
|
ncApi.sendLocation(
|
||||||
ApiUtils.getCredentials(userUtils.currentUser?.username, userUtils.currentUser?.token),
|
ApiUtils.getCredentials(userUtils.currentUser?.username, userUtils.currentUser?.token),
|
||||||
|
@ -382,7 +382,9 @@
|
|||||||
<string name="nc_location_permission_required">location permission is required</string>
|
<string name="nc_location_permission_required">location permission is required</string>
|
||||||
<string name="nc_share_current_location">Share current location</string>
|
<string name="nc_share_current_location">Share current location</string>
|
||||||
<string name="nc_share_this_location">Share this location</string>
|
<string name="nc_share_this_location">Share this location</string>
|
||||||
|
<string name="nc_shared_location">Shared location</string>
|
||||||
<string name="nc_location_current_position_description">Your current location</string>
|
<string name="nc_location_current_position_description">Your current location</string>
|
||||||
|
<string name="nc_location_unknown">Position unknown</string>
|
||||||
|
|
||||||
<!-- voice messages -->
|
<!-- voice messages -->
|
||||||
<string name="nc_voice_message_filename">Talk recording from %1$s (%2$s)</string>
|
<string name="nc_voice_message_filename">Talk recording from %1$s (%2$s)</string>
|
||||||
@ -451,5 +453,4 @@
|
|||||||
<string name="filename_progress">%1$s (%2$d)</string>
|
<string name="filename_progress">%1$s (%2$d)</string>
|
||||||
<string name="nc_dialog_invalid_password">Invalid password</string>
|
<string name="nc_dialog_invalid_password">Invalid password</string>
|
||||||
<string name="nc_dialog_reauth_or_delete">Do you want to reauthorize or delete this account?</string>
|
<string name="nc_dialog_reauth_or_delete">Do you want to reauthorize or delete this account?</string>
|
||||||
<string name="nc_location_unknown">Position unknown</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user