Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trust new identities #206

Merged
merged 4 commits into from
Nov 16, 2023
Merged

fix: trust new identities #206

merged 4 commits into from
Nov 16, 2023

Conversation

gferon
Copy link
Collaborator

@gferon gferon commented Nov 16, 2023

I never realized this was wrong, and I guess I kept re-linking as part of my tests, but there was no way for presage since a very long time (maybe even forever) to receive messages from a contact that changed their identity (which happens when you change your phone, for example).

This PR fixes this and follows the default behavior of official Signal clients.

A SyncMessage is inserted in the 1-1 thread with the contact whose identity changed, which a client can interpret to display the "Your safety number with [CONTACT] has changed".

Currently, the values are used in the following way:

  • verified::State::Default will always be saved in the timeline when the new identity is saved
  • verified::State::Unverified will be save in the timeline when the safety number changed, letting developers display a warning to users.

Note: there is currently no way to manually mark some identity as verified in the timeline, but one could do it manually in a client.

Closes #181

@gferon gferon changed the title Trust new identities fix: trust new identities Nov 16, 2023
@gferon gferon force-pushed the trust-new-identities branch 2 times, most recently from 08f230a to 6c99e03 Compare November 16, 2023 20:01
@gferon gferon enabled auto-merge (squash) November 16, 2023 20:14
@gferon gferon merged commit 46f6226 into main Nov 16, 2023
4 checks passed
@gferon gferon deleted the trust-new-identities branch November 16, 2023 20:15
@gferon gferon added this to the 0.6.0 milestone Nov 19, 2023
Schmiddiii added a commit to Schmiddiii/presage that referenced this pull request Nov 28, 2023
Outgoing messages in 1-to-1 chats were stored in the note-to-self chat.
This was broken in 6125534. This will be fixed by this MR.

This also fixes the timestamp of identity verification messages, which
are inserted into the store by presage. By convention, all timestamps
used are in milliseconds, this one was in seconds. This was wrong since whisperfish#206.
Schmiddiii added a commit to Schmiddiii/presage that referenced this pull request Nov 29, 2023
Outgoing messages in 1-to-1 chats were stored in the note-to-self chat.
This was broken in 6125534. This will be fixed by this MR.

This also fixes the timestamp of identity verification messages, which
are inserted into the store by presage. By convention, all timestamps
used are in milliseconds, this one was in seconds. This was wrong since whisperfish#206.
gferon pushed a commit that referenced this pull request Dec 5, 2023
Outgoing messages in 1-to-1 chats were stored in the note-to-self chat.
This was broken in 6125534. This will be fixed by this MR.

This also fixes the timestamp of identity verification messages, which
are inserted into the store by presage. By convention, all timestamps
used are in milliseconds, this one was in seconds. This was wrong since #206.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detection of changed safety number
1 participant