Currently, if a preview has been generated, and the user edits the message that triggered the preview, urlpreview sends the preview again. Ideally, urlpreview would never send the same preview multiple times (this would be useful even when a message is not edited -- for example, if someone responds to a message with the same link for some reason). An alternative would be to not generate previews on edited messages, or not generate previews unless the hyperlink in the message has been edited.
Here's a patch that keeps track of URLs that have already been previewed to the room in connection with a particular message, and skips re-generating the preview if already done.
urlpreview-cache.patch
Currently, if a preview has been generated, and the user edits the message that triggered the preview, urlpreview sends the preview again. Ideally, urlpreview would never send the same preview multiple times (this would be useful even when a message is not edited -- for example, if someone responds to a message with the same link for some reason). An alternative would be to not generate previews on edited messages, or not generate previews unless the hyperlink in the message has been edited.