<p></p>
<p>Here's one candidate: reading a message (via GET /message/id) updates the message_read flag:</p>
<div class="highlight highlight-source-ruby"><pre>  <span class="pl-c"><span class="pl-c">#</span> Show a message</span>
  <span class="pl-k">def</span> <span class="pl-en">show</span>
    <span class="pl-smi">@title</span> <span class="pl-k">=</span> t <span class="pl-s"><span class="pl-pds">"</span>.title<span class="pl-pds">"</span></span>
    <span class="pl-smi">@message</span> <span class="pl-k">=</span> <span class="pl-c1">Message</span>.find(params[<span class="pl-c1">:id</span>])

    <span class="pl-k">if</span> <span class="pl-smi">@message</span>.recipient <span class="pl-k">==</span> current_user <span class="pl-k">||</span> <span class="pl-smi">@message</span>.sender <span class="pl-k">==</span> current_user
      <span class="pl-smi">@message</span>.message_read <span class="pl-k">=</span> <span class="pl-c1">true</span> <span class="pl-k">if</span> <span class="pl-smi">@message</span>.recipient <span class="pl-k">==</span> current_user
      <span class="pl-smi">@message</span>.save            <span class="pl-k"><<<<<<</span><span class="pl-k"><</span>
    <span class="pl-k">else</span></pre></div>
<p><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/5842757/77845732-6ff99880-71b1-11ea-9444-94fbf034c9b3.png"><img src="https://user-images.githubusercontent.com/5842757/77845732-6ff99880-71b1-11ea-9444-94fbf034c9b3.png" alt="image" style="max-width:100%;"></a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2563#issuecomment-605609928">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJ6F77GOHG6CNTXEI3RJ4JM7ANCNFSM4LOVDDGQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLKRXBQB7JNKXPD3GELRJ4JM7A5CNFSM4LOVDDG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEQMN7SA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2563#issuecomment-605609928",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2563#issuecomment-605609928",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>