Contact email: follow-up given with a report is kept and removable; match by rev

- Ticking follow-up questions on a report makes that address the contact
  email (follow-up ticked, update choice unchanged), so Settings shows it
  and Remove my email withdraws it like any other.
- Reports carry contact_rev; the inbox takes a report's follow-up
  permission back when a later change from that copy (higher rev) no
  longer agrees, whatever the clocks say.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-10-01 21:08:16 +10:00
1 parent 01d5c612c0
commit 08d75e3ffb
6 files changed
+117 -75

No files matched your search

+11 -7
View File
@@ -79,14 +79,18 @@ def flag(body, key):
return v is True
def contact_id():
"""This copy's contact id, kept from now on. A report with follow-up consent carries it, so
removing the address later takes back the follow-up permission given with the report too."""
with _lock:
def from_report(email):
"""Follow-up questions agreed to with a problem report: the address becomes the contact
email with that choice ticked (the update choice stays as it was), so it shows in Settings
and is removed the same way. Returns (contact id, rev) for the report to carry: a later
change from this copy has a higher rev, and the newest such change decides whether the
report's follow-up permission still stands, whatever the clocks say."""
s = load()
if s['email'].lower() != email.lower() or not s['followup']:
save({'email': s['email'] if s['email'].lower() == email.lower() else email,
'updates': s['updates'], 'followup': True})
s = load()
if not FILE.exists():
_save(s)
return s['id']
return s['id'], s['rev']
def state():