Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some links inside messages are rendered as “in reply to” #4586

Closed
ShadowJonathan opened this issue Jul 21, 2021 · 2 comments · Fixed by #6245
Closed

Some links inside messages are rendered as “in reply to” #4586

ShadowJonathan opened this issue Jul 21, 2021 · 2 comments · Fixed by #6245
Labels
A-Timeline O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Papercuts Visible. Impactful. Predictable to action. Z-WTF WTF issues: High impact, Low Effort

Comments

@ShadowJonathan
Copy link
Contributor

ShadowJonathan commented Jul 21, 2021

image

Full source;

Code
{
  "sender" : "@rss:maunium.net",
  "content" : {
    "body" : "> <@tulir:maunium.net> !rss subscriptions\n\n**Subscriptions in this room:**\n\n● 224 - Element Blog (https:\/\/element.io\/blog\/rss\/) (subscribed by @tulir:maunium.net)\n    ⚠️ The last 23 attempts to fetch the feed have failed!",
    "msgtype" : "m.notice",
    "format" : "org.matrix.custom.html",
    "m.relates_to" : {
      "event_id" : "$nwhovtLviu_GBx5A6spm9ceDCNAZRxP5z03zBYpSDjQ",
      "m.in_reply_to" : {
        "event_id" : "$nwhovtLviu_GBx5A6spm9ceDCNAZRxP5z03zBYpSDjQ"
      },
      "rel_type" : "net.maunium.reply"
    },
    "formatted_body" : "<mx-reply><blockquote><a href='https:\/\/matrix.to\/#\/!EgoVrPyOnPSVXERlxj:gruenhage.xyz\/$nwhovtLviu_GBx5A6spm9ceDCNAZRxP5z03zBYpSDjQ'>In reply to<\/a> <a href='https:\/\/matrix.to\/#\/@tulir:maunium.net'>@tulir:maunium.net<\/a><br\/>!rss subscriptions<\/blockquote><\/mx-reply><p><strong>Subscriptions in this room:<\/strong><\/p>\n<ul>\n<li>224 - <a href=\"https:\/\/element.io\/blog\/rss\/\">Element Blog<\/a> (subscribed by <a href=\"https:\/\/matrix.to\/#\/@tulir:maunium.net\">@tulir:maunium.net<\/a>)<br \/>\n⚠️ The last 23 attempts to fetch the feed have failed!<\/li>\n<\/ul>\n"
  },
  "origin_server_ts" : 1626878135686,
  "room_id" : "!EgoVrPyOnPSVXERlxj:gruenhage.xyz",
  "event_id" : "$oONVX1DHk-UslcE6BwJIfoOb_iP5jHOG8BFFPqnKlRU",
  "unsigned" : {
    "age" : 59419
  },
  "type" : "m.room.message"
}

Version: 1.4.5

@pixlwave pixlwave added Z-Impact-3 Z-Papercuts Visible. Impactful. Predictable to action. Z-Visibility-2 labels Aug 17, 2021
@ShadowJonathan
Copy link
Contributor Author

ShadowJonathan commented Dec 3, 2021

I just found out where this happens;

https://github.com/matrix-org/matrix-ios-kit/blob/e9c616ec368fbe2c2607fea7ab427c7967d016d6/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m#L1840

Long story short, it's taking advantage of reply fallbacks, and is using a regex to find the first a tag.


As an extra note; there have been a few things said about using regex to match html...

@ShadowJonathan
Copy link
Contributor Author

The specific case above is because the initial two links in the fallback use ' quotation marks instead of ".

However, instead of simply fixing this, I'm asking if someone can look at the whole bit of needed code, and find a way to rip it out instead.

@pixlwave pixlwave added A-Timeline O-Occasional Affects or can be seen by some users regularly or most users rarely T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-WTF WTF issues: High impact, Low Effort S-Minor Impairs non-critical functionality or suitable workarounds exist and removed Z-Visibility-2 Z-Impact-3 labels Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Timeline O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Papercuts Visible. Impactful. Predictable to action. Z-WTF WTF issues: High impact, Low Effort
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants