mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
add keyMatch value to user
This commit is contained in:
parent
e633009e9d
commit
b3f32238c8
2 changed files with 11 additions and 2 deletions
|
|
@ -847,8 +847,16 @@ func textMessageAppPacket(
|
|||
}
|
||||
if fetchedUsers.first(where: { $0.num == packet.from }) != nil {
|
||||
newMessage.fromUser = fetchedUsers.first(where: { $0.num == packet.from })
|
||||
newMessage.fromUser?.publicKey = packet.publicKey
|
||||
newMessage.fromUser?.pkiEncrypted = packet.pkiEncrypted
|
||||
if !(newMessage.fromUser?.publicKey?.isEmpty ?? true) {
|
||||
/// We have a key, check if it matches
|
||||
if newMessage.fromUser?.publicKey != newMessage.publicKey {
|
||||
newMessage.fromUser?.keyMatch = false
|
||||
}
|
||||
} else {
|
||||
/// We have no key, set it
|
||||
newMessage.fromUser?.publicKey = packet.publicKey
|
||||
newMessage.fromUser?.pkiEncrypted = packet.pkiEncrypted
|
||||
}
|
||||
if packet.rxTime > 0 {
|
||||
newMessage.fromUser?.userNode?.lastHeard = Date(timeIntervalSince1970: TimeInterval(Int64(packet.rxTime)))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -432,6 +432,7 @@
|
|||
<attribute name="hwModel" attributeType="String"/>
|
||||
<attribute name="hwModelId" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="isLicensed" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||
<attribute name="keyMatch" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
||||
<attribute name="lastMessage" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
||||
<attribute name="longName" attributeType="String"/>
|
||||
<attribute name="mute" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue