<p dir="auto"><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #4750.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2276495794" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4750" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/4750/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/4750">#4750</a> by redirecting when "Mark as unread" is clicked on a message page. For example Github notifications work like that: if you mark a notification as unread it redirects you to the notifications list.</p>
<p dir="auto">I rename the <code class="notranslate">unread_message</code> variable in tests because the message doesn't stay unread.</p>
<p dir="auto">I reuse the xhr test lines for referer test because xhr is not in use since the Turbo update.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/4752'>https://github.com/openstreetmap/openstreetmap-website/pull/4752</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4752/commits/4c21a09b32f3335be2c8d7c70f6b3c4adabfb63d" class="commit-link">4c21a09</a>  Rename unread_message to message in messages controller test</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4752/commits/5da2957591e88bb23ca2e3670edece200e15b027" class="commit-link">5da2957</a>  Redirect to inbox after marking a message as read/unread disregarding referer</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4752/files">2 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4752/files#diff-9b58332ea76756301b1aafeacfb0659d1244ba014947602b0e0bf2d0f2921d26">app/controllers/messages_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4752/files#diff-ddf5d19fd2916b2a385e2be7541e2229667490427938e04c2e1fdf1d1517385c">test/controllers/messages_controller_test.rb</a>
    (66)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4752.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4752.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4752.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4752.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4752">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLMGPWD7BNU7NYJANTZAYS5DAVCNFSM6AAAAABHHWJJACVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3TSNJRGY3DENQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLL5YUN4V46BQF73YFDZAYS5DA5CNFSM6AAAAABHHWJJACWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHIPXVJ2I.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4752</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4752",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4752",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>