decent-chat / decent

Open source messaging platform for the modern web
https://meta.decent.chat
GNU General Public License v3.0
21 stars 5 forks source link

Long messages are not truncated upon display #280

Open joker314 opened 6 years ago

joker314 commented 6 years ago

Expected Behaviour

When you receive a really long message, it shouldn't take up the whole screen, because that's annoying

Actual behaviour

The full message is displayed

Steps to reproduce

1) Go to a server where you can write messages 2) Send a message which is very very long 3) Observe that it takes up all the space

Suggested fix

This needs discussion. We want to be able to allow paragraphed and mature discussion; but we don't want people to be able to spam. Options from other sites:

towerofnix commented 6 years ago

Ping @PullJosh especially for design input.

towerofnix commented 6 years ago

Taking up server memory is unfortunately not something we've dealt with at all, yet... it's very easy to quickly send tons of long, space-taking messages. (Or, more directly, to upload many images, but that's another topic.)

Would a combination of your third and fourth suggestions work? I love the third idea for its UI but I wonder if it makes sense to have a (very long) character limit as well.

bates64 commented 6 years ago

We can make the character limit a server setting? (Alongside Delete messages after (n) years etc.)

bates64 commented 6 years ago

We should also truncate message length in the pins and mentions tabs in the right sidebar. Because there's so little space for the message even not-too-long ones end up taking loads of vertical space.

joker314 commented 6 years ago

I like the server setting idea, but as Flo said, we'll need to have a hard think about how to ensure people can't crash the server.

I agree that we should definitely cut the messages off in pins and mentions, but we should be careful about languages where different characters are used depending on where a letter appears in a word.

bates64 commented 6 years ago

we'll need to have a hard think about how to ensure people can't crash the server

If a server admin sets the limit to 9000000, it's not our problem. I want to allow server owners to have as much freedom as possible; but we could default the limit to 500.

joker314 commented 6 years ago

Okay, but what about writing several messages successively, does Decent have adequate rate limiting?

bates64 commented 6 years ago

Decent has no rate-limiting as of yet. (We should include this into 1.0.0 @towerofnix!)

joker314 commented 6 years ago

Right, this should probably change at some point. Has a separate issue been filed?

towerofnix commented 6 years ago

Rate limiting is almost a separate topic (though related). I don't think there's an issue for it yet. One thought on how it should be implemented is how to prevent users from simply signing up another account and spamming with that one (if we limit per-account). Except for on authorized servers / servers where users have no write permission by default, anybody can post data simply by registering.

bates64 commented 6 years ago

We could rate-limit the register endpoint at 2 successful requests/day or something?

joker314 commented 6 years ago

Per IP? People can use proxy scripts and such, it's not too likely to work. You could try and place a CAPTCHA restriction?

towerofnix commented 6 years ago

@joker314 I extremely am not going to depend on Google for the sake of captcha. I'd much sooner default servers to simply not give users write permissions without an admin adding a "chat" role.

bates64 commented 6 years ago

@towerofnix note that there are other CAPTCHA providers than Google, although theirs is objectively the best. Regardless, I want registers to be open so bots can register themselves on a server.