Commit 085f270
committed
oembed: ignore oembed results from mastodon
This adds a check in the oembed preview for cases where the oembed
is going to contain less information than the OpenGraph; in these
cases, the oembed is ignored and the OpenGraph data is retained.
At the moment, the only case in here is Mastodon posts, but it
could be expanded in the future.
Mastodon's oembed is JavaScript based and only contains stub HTML
that's intended to be filled in by client-side JavaScript that
synapse doesn't execute. It doesn't contain the actual post text.
The og:description, on the other hand, does contain the post text.
When synapse unilaterally prefers the oembed over OpenGraph, it
ends up accidentally filling in a generic and non-useful preview
in place of the actual post content.1 parent 09fd264 commit 085f270
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
235 | 247 | | |
236 | 248 | | |
237 | 249 | | |
| |||
273 | 285 | | |
274 | 286 | | |
275 | 287 | | |
276 | | - | |
| 288 | + | |
277 | 289 | | |
0 commit comments