Cheogram Android has an option to send link previews. What does this option do?

It scans the body of the message for URLs (as per the autolink logic already in the app) and for any that are https it does a HEAD request. If content-type is `image/*` or `audio/*` or `video/*` or `application/pdf` it treats this as an HTTP upload message where this URL is already uploaded. So that is, OOB and SIMS get set up and this URL is the URL source. If the URL is the whole body, then the fallback tag is set across the whole body as normal, otherwise a null fallback is set to allow the link to still display in its place in the text along with the attachment.

If the HEAD gets a content type of `text/html` or `application/xhtml+xml` then it scans the first 4000 bytes for OpenGraph tags and converts them into RDF/XML syntax as a direct child of the message stanza, like so:

<message to="">
    <body>I wanted to mention</body>
    <rdf:Description xmlns:rdf="" xmlns:og="" rdf:about="">
        <og:title>Page Title</og:title>
        <og:description>Page Description</og:description>
        <og:url>Canonical URL</og:url>
        <og:site_name>Some Website</og:site_name>

CheogramApp/LinkPreviews (last edited 2023-287 23:40:23 by Singpolyma)