zulip / zulip-flutter

Upcoming Zulip mobile apps for Android and iOS, using Flutter
Apache License 2.0
202 stars 195 forks source link

Handle legacy form of `message_inline_image` #964

Open gnprice opened 2 months ago

gnprice commented 2 months ago

Up until 2019 (Zulip 2.1, I think), the div.message_inline_image elements that the server produced could look different from how they look now. We don't yet support the older form. It still appears in old messages, which is why it's still relevant (but not a priority).

Found by @PIG208 with the survey https://github.com/zulip/zulip-flutter/pull/917 / https://github.com/zulip/zulip-flutter/issues/190.

Example message. I'm not sure if the issue affects all inline image previews up to that point, or only a subset of them. That's the last public message on CZO that is affected.

Diff by @PIG208 comparing old vs. new format:

  <p>
-   <a href="https://www.dropbox.com/s/7vb5y14vr73lt3r/2018-07-27%2018.51.30.jpg?dl=0" target="_blank" title="https://www.dropbox.com/s/7vb5y14vr73lt3r/2018-07-27%2018.51.30.jpg?dl=0">https://www.dropbox.com/s/7vb5y14vr73lt3r/2018-07-27%2018.51.30.jpg?dl=0</a>
+   <a href="https://www.dropbox.com/s/7vb5y14vr73lt3r/2018-07-27%2018.51.30.jpg?dl=0">https://www.dropbox.com/s/7vb5y14vr73lt3r/2018-07-27%2018.51.30.jpg?dl=0</a>
  </p>
  <div class="message_inline_image">
-   <a href="https://www.dropbox.com/s/7vb5y14vr73lt3r/2018-07-27%2018.51.30.jpg?dl=0" target="_blank" title="2018-07-27 18.51.30.jpg">
+   <a href="https://www.dropbox.com/s/7vb5y14vr73lt3r/2018-07-27%2018.51.30.jpg?dl=0" title="2018-07-27 18.51.30.jpg">
-     <img src="https://www.dropbox.com/s/7vb5y14vr73lt3r/2018-07-27%2018.51.30.jpg?dl=1">
+     <img src="/external_content/82ccbf2c8cb498e0ef6d5a78d18dca92d208c0eb/68747470733a2f2f7777772e64726f70626f782e636f6d2f732f37766235793134767237336c7433722f323031382d30372d323725323031382e35312e33302e6a70673f7261773d31">
    </a>
  </div>