matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
465 stars 150 forks source link

Messages which contain code blocks (or other advanced formatting) should be pastebinned #1172

Open Half-Shot opened 3 years ago

Half-Shot commented 3 years ago

Even if they are below the line limit. This is a request from GNOME who disabled the minimum length for a pastebinned message, but now have the problem where some long messages come through in a awkward manner.

thibaultamartin commented 3 years ago

To give a bit more detail, the solution our IRC users found to be the most convenient was to turn e.g. the following message

There seems to be an issue in my code:
\```
def funct_that_crashes(foo):
    print("Will it crash?")
    crash()
    print("Never seeing that message")
\```

as

There seems to be an issue in my code:
https://matrix.foo.org/path/to/the/code/message

(I put a \ before the triple backticks so Github didn’t use it).

One source of frustration for them was to have to open a URL to know what a message is about. If they can get the non-code part of the message as an IRC message plus the code as an URL, that would be the best solution!

benzea commented 3 years ago

Seems related, today I got a message with just code (it was clear from the context). It was

11:29  * gabmus[m] sent a long message:  < https://gnome.modular.im/_matrix/media/r0/download/gnome.org/925c41bd652788265bf4d21619c9e2a31d738936/message.txt >

For me the weird part was that it downloaded as a text. i.e. when retrieving the URL the servers sets Content-Disposition: attachment; filename=message.txt and I feel that is not helpful, as I don't want to download that file but just view it.