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

[Matrix] Files uploaded from Sailtrix are sent as plain message "sailtrix-file.png" instead of a link to the file #1575

Closed
Mikaela opened this issue Aug 26, 2021 · 8 comments

Comments

@Mikaela
Copy link

Mikaela commented Aug 26, 2021

Describe the bug

When I upload a picture from Sailtrix Matrix client, matterbridge sends a message sailtrix-file.png to other protocols instead of downloading and linking to the file itself.

To Reproduce

  • Upload a file from Sailtrix. However this can be tricky as it's for SailfishOS which isn't so common mobile OS.
  • Observe matterbridge.

Expected behavior

Link to media repostiory is provided.

Screenshots/debug logs

I am not sure either is necessary.

Environment (please complete the following information):

  • OS: Debian 11
  • Matterbridge version: 1.22.2 641ed18

Additional context

Non-working event source (Sailtrix):

{
  "type": "m.room.message",
  "sender": "@mikaela:feneas.org",
  "content": {
    "body": "sailtrix-file.png",
    "msgtype": "m.image",
    "url": "mxc://matrix.feneas.org/17addca646e8167dd88e80b92b804e71cf02ce19"
  },
  "origin_server_ts": 1629970406976,
  "unsigned": {
    "age": 7255
  },
  "event_id": "$RptGxdCco3P-CTrdWsf2VSb8EaITwFfAMZhzYH9-xWQ",
  "room_id": "!ZFnQcqwxcebAepncKr:feneas.org"
}

Working event source (develop.element.io):

{
  "type": "m.room.message",
  "sender": "@mikaela:feneas.org",
  "content": {
    "body": "image.png",
    "info": {
      "size": 242542,
      "mimetype": "image/png",
      "thumbnail_info": {
        "w": 737,
        "h": 600,
        "mimetype": "image/png",
        "size": 140712
      },
      "w": 1248,
      "h": 1015,
      "xyz.amorgan.blurhash": "L45hP$~E-qRjEKInNFofI:InNFof",
      "thumbnail_url": "mxc://matrix.feneas.org/7ff8deafed136f893dab7b750e759f59b9c90988"
    },
    "msgtype": "m.image",
    "url": "mxc://matrix.feneas.org/f4c2deb09e765bcf001e1bdb29ad9acbf2816637"
  },
  "origin_server_ts": 1629970817676,
  "unsigned": {
    "age": 8307,
    "transaction_id": "m1629970817374.12"
  },
  "event_id": "$kd3dAUle5zu1od-K3NIi8w_z3o2N2yyOmchHR2Z7Cmg",
  "room_id": "!ZFnQcqwxcebAepncKr:feneas.org"
}
@Mikaela Mikaela added the bug label Aug 26, 2021
@Mikaela
Copy link
Author

Mikaela commented Aug 26, 2021

The original report was with Sailtrix 1.3.0, 1.3.1 was released a moment ago and and while it has mimetype in uploads, matterbridge still doesn't recognise it.

{
  "type": "m.room.message",
  "sender": "@mikaela:feneas.org",
  "content": {
    "body": "sailtrix-file.png",
    "info": {
      "mimetype": "image/png"
    },
    "msgtype": "m.image",
    "url": "mxc://matrix.feneas.org/052acc28c67fb2a5bf223166e9f4210a937c32c4"
  },
  "origin_server_ts": 1629989550510,
  "unsigned": {
    "age": 6458
  },
  "event_id": "$cajzMaOfd17eoj3QHMYtBG101S5UeljsDlNoAtIiW_Y",
  "room_id": "!LSWnevuzcRXZZKhqso:privacytools.io"

@Mikaela
Copy link
Author

Mikaela commented Aug 31, 2021

While I understand this to be issue on Matterbridge side, Sailtrix has a matterbridge compatibility issue.

@42wim 42wim added the matrix label Oct 17, 2021
@42wim
Copy link
Owner

42wim commented Oct 24, 2021

It fails because it needs the size and mimetype field. I can work around the mimetype field, but it needs to size to check if it can download it.

@42wim
Copy link
Owner

42wim commented Oct 24, 2021

I'm going to close this now as it is an sailtrix issue.

@42wim 42wim closed this as completed Oct 24, 2021
@42wim 42wim added the cantfix label Oct 24, 2021
@HengYeDev
Copy link

I have pushed a Sailtrix fix which adds the size field. https://gitlab.com/HengYeDev/harbour-sailtrix/-/merge_requests/17

@42wim
Copy link
Owner

42wim commented Oct 28, 2021

@Mikaela as @HengYeDev has merged his changes this should work now, if not feel free to reopen

@Mikaela
Copy link
Author

Mikaela commented Oct 31, 2021

Sorry for long response time, I have updated Sailtrix on my SailfishOS and can confirm that the new version resolves this and media uploads are getting Matterbridged when sent from it

@HengYeDev
Copy link

@Mikaela Thanks. Sailtrix gitlab issue closed as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants