Attaching a damaged HEIC photo failed badly: the chat input did nothing, a channel showed "[object Object]" and a note showed an upload that never finished. Now each of them shows an error and attaches nothing. Photos that convert fine upload as before.
Fixes#35580
After a burst of file uploads and long chats, the process kept most of the memory it needed at the peak, and every further burst added more. On Linux with glibc, blocks of 1 MB and larger now go back to the system as soon as they are freed, which stops the growth, and every 30 seconds the freed memory glibc still holds is returned too, which brings the level down further. `MALLOC_RELEASE_THRESHOLD` sets that size in bytes and `MALLOC_TRIM_INTERVAL` that interval in seconds, and `0` turns either one off. While the threshold is on, it overrides glibc's own `MALLOC_MMAP_THRESHOLD_` and `MALLOC_TRIM_THRESHOLD_`. The median request took about 9% longer on this upload-heavy load (9.8 s to 10.7 s) with both on.
900 chats with a file upload each, in six bursts of 150. The process sat at 1.18 GB before the load in every run.
<table>
<tr><th></th><th>Memory after the load</th></tr>
<tr><td>Without the change</td><td>4.47 GB, still climbing</td></tr>
<tr><td>Immediate release only</td><td>1.95 GB</td></tr>
<tr><td>Periodic release only</td><td>4.26 GB, still climbing</td></tr>
<tr><td>Both</td><td>1.52 GB, flat</td></tr>
</table>
Fixes#35590
Opening a share link for a chat you were allowed to reply to briefly showed the owner's chat and then, now and then, switched to the home page. This happened more often on a slow connection or a busy machine. The link now goes straight to the owner's live chat for everyone allowed to reply, and still shows the read-only copy to everyone else.
Fixes#35562
Closing Settings did not take the web address back to the page it was opened from, so the next click in the sidebar carried the open Settings along and showed it again on top of the new page. Browser Back also failed to close Settings, and switching tabs inside it added extra Back steps. Closing now returns to the previous page, and Back and Forward move in and out of Settings in one step.
Fixes#35563