mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 15:45:22 +00:00
country -> region, region –> province (#298)
This commit is contained in:
@@ -8,8 +8,8 @@ enum class GeohashChannelLevel(val precision: Int, val displayName: String) {
|
||||
BLOCK(7, "Block"),
|
||||
NEIGHBORHOOD(6, "Neighborhood"),
|
||||
CITY(5, "City"),
|
||||
REGION(4, "Region"),
|
||||
COUNTRY(2, "Country");
|
||||
PROVINCE(4, "Province"),
|
||||
REGION(2, "REGION");
|
||||
|
||||
companion object {
|
||||
fun allCases(): List<GeohashChannelLevel> = values().toList()
|
||||
|
||||
@@ -309,14 +309,14 @@ class LocationChannelManager private constructor(private val context: Context) {
|
||||
|
||||
// Country
|
||||
address.countryName?.takeIf { it.isNotEmpty() }?.let {
|
||||
dict[GeohashChannelLevel.COUNTRY] = it
|
||||
dict[GeohashChannelLevel.REGION] = it
|
||||
}
|
||||
|
||||
// Region (state/province or county)
|
||||
// Province (state/province or county)
|
||||
address.adminArea?.takeIf { it.isNotEmpty() }?.let {
|
||||
dict[GeohashChannelLevel.REGION] = it
|
||||
dict[GeohashChannelLevel.PROVINCE] = it
|
||||
} ?: address.subAdminArea?.takeIf { it.isNotEmpty() }?.let {
|
||||
dict[GeohashChannelLevel.REGION] = it
|
||||
dict[GeohashChannelLevel.PROVINCE] = it
|
||||
}
|
||||
|
||||
// City (locality)
|
||||
|
||||
Reference in New Issue
Block a user