mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: simplify setOwner logic
This commit is contained in:
parent
956db658e9
commit
7ca724142f
3 changed files with 10 additions and 27 deletions
|
|
@ -2,6 +2,7 @@ package com.geeksville.mesh
|
|||
|
||||
import android.graphics.Color
|
||||
import android.os.Parcelable
|
||||
import com.geeksville.mesh.MeshProtos.User
|
||||
import com.geeksville.mesh.util.bearing
|
||||
import com.geeksville.mesh.util.latLongToMeter
|
||||
import com.geeksville.mesh.util.anonymize
|
||||
|
|
@ -27,6 +28,9 @@ data class MeshUser(
|
|||
return "MeshUser(id=${id.anonymize}, longName=${longName.anonymize}, shortName=${shortName.anonymize}, hwModel=${hwModelString}, isLicensed=${isLicensed})"
|
||||
}
|
||||
|
||||
fun toProto(): User = User.newBuilder().setId(id).setLongName(longName).setShortName(shortName)
|
||||
.setHwModel(hwModel).setIsLicensed(isLicensed).build()
|
||||
|
||||
/** a string version of the hardware model, converted into pretty lowercase and changing _ to -, and p to dot
|
||||
* or null if unset
|
||||
* */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue