Merge pull request #1394 from nextcloud/bugfix/1393/locationNameNotNull

set locationName to "Shared location" when geocoding failed
This commit is contained in:
Joas Schilling 2021-07-05 13:41:27 +02:00 committed by GitHub
commit 9c00003308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

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

View File

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