codingteam / emulsion

XMPP ↔ Telegram bridge
MIT License
33 stars 3 forks source link

Decide the policy regarding large messages #139

Open Minoru opened 3 years ago

Minoru commented 3 years ago

This stems from a small discussion we had in Codingteam. Key points are:

I have a couple ideas on how to resolve this mismatch:

  1. when translating large messages from Matrix to XMPP (and possibly Telegram), keep the first few lines, and pack the rest into a pastebin link. As ForNeVeR points out, this requires us to run a pastebin service :)
  2. translate the message as-is, but send the author a private message explaining the situation and asking to keep their message lengths in check. ttldtor points out that the author might have blocked the bot, and will not see the message
ForNeVeR commented 3 years ago

Okay, here's what I would propose.

  1. Yes, implement our small pastebin-like service. It should be able to store a big text in its database, and respond with it in HTML format (applying the guessed or optionally user-suggested highlighting scheme).
  2. There will be two write entrypoints in the service:
    • automatic creation of pastes from big pasted texts from Telegram (and Matrix in future), where the "pasted text" is detected from the markup (it is a more or less usual thing to paste big texts in both Telegram and Matrix, while marking them up properly using the formatting features)
    • manual paste creation via the bot private messages
  3. If the paste is created automatically, then the link to the paste should be sent to XMPP instead of its content.
  4. If the paste was created manually (via private messages), then send the message link to the paste author.
  5. There should be an admin interface to check paste download counts, contents and authorship, and to delete pastes (to prevent abuse).
  6. We should warn the users that the pastes aren't private.