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

Large Telegram messages should go on pastebin #56

Open
mxa opened this issue Jun 6, 2018 · 22 comments
Open

Large Telegram messages should go on pastebin #56

mxa opened this issue Jun 6, 2018 · 22 comments
Labels
good first issue Good for newcomers help wanted Anyone is welcome to help us with this! improvement Improves on something that already exists
Milestone

Comments

@mxa
Copy link

mxa commented Jun 6, 2018

IRC users get annoyed when one Telegram user posts a codeblock or just a multiline message.
It should be configurable that preformatted multilined text and any other text with >n carriage returns/newlines automatically are turned into a pastebin to be linked to in the IRC.

see also: FruitieX/teleirc#249

@jwflory jwflory added improvement Improves on something that already exists help wanted Anyone is welcome to help us with this! priority:high labels Jun 6, 2018
@jwflory jwflory added this to the v1.2 milestone Jun 6, 2018
@jwflory jwflory modified the milestones: v1.2, v1.2.1 Oct 14, 2018
@jwflory jwflory modified the milestones: v1.2.2, v1.3 Nov 24, 2018
@jwflory jwflory added the good first issue Good for newcomers label Nov 24, 2018
@Tjzabel
Copy link
Member

Tjzabel commented Dec 6, 2018

For future reference when this gets worked on, we can use Fedora's Pastebin. They have a well-documented API to work with:

@jwflory
Copy link
Member

jwflory commented Dec 6, 2018

@Tjzabel It is also worth noting that paste.fp.o is ephemeral. Pastes will eventually expire and be deleted. We should consider if this is something we are okay with or if persistent pastes are important. I lean towards wanting persistence.

@Tjzabel
Copy link
Member

Tjzabel commented Dec 6, 2018

@jwflory it's worth noting that while paste.fp.o is generally ephemeral, there is an option to set no expiry date when uploading through their API.

@Tjzabel
Copy link
Member

Tjzabel commented Dec 12, 2018

With that being said, do we want to have an ENV option to set a length of time for the paste to be active for? Or do we just want this to never expire.

@jwflory
Copy link
Member

jwflory commented Dec 12, 2018

@Tjzabel Oh, actually yes! I like giving this option to the user, maybe with a default value of a 90-day expiration.

@jwflory jwflory modified the milestones: v1.3, v1.4 Feb 2, 2019
@jwflory jwflory added this to Backlog in TeleIRC development Feb 2, 2019
@jwflory jwflory moved this from Backlog to Next sprint in TeleIRC development Feb 9, 2019
@jwflory jwflory moved this from Next sprint to Backlog in TeleIRC development Mar 2, 2019
@jwflory jwflory removed this from the v1.4 milestone Mar 3, 2019
@jwflory
Copy link
Member

jwflory commented Mar 3, 2019

This ticket was pushed to the backlog for now. This could be a good candidate for a v1.5 sprint. In the meanwhile, sprint development time will not be allocated to this ticket for now.

If someone in the community wanted to work on this or make a contribution, this would be an excellent place to start! 🎉

@Tjzabel
Copy link
Member

Tjzabel commented Aug 20, 2019

WWeeelllll, it looks like paste.fp.o is being retired in favor of another solution. It may not be a good idea at this point to create this feature surrounding that platform.

@jwflory
Copy link
Member

jwflory commented Aug 30, 2019

Hastebin is another reliable favorite. You can send txt documents directly to their backend for easy uploads.

@Tjzabel Tjzabel removed this from Backlog in TeleIRC development Sep 15, 2019
@jwflory jwflory added this to the v2.x.x milestone Feb 16, 2020
@jwflory jwflory added this to Backlog in TeleIRC development via automation Feb 27, 2020
@nasirhm
Copy link

nasirhm commented Jun 13, 2020

I would like to work on it.

@jwflory
Copy link
Member

jwflory commented Jun 14, 2020

@Tjzabel:
WWeeelllll, it looks like paste.fp.o is being retired in favor of another solution. It may not be a good idea at this point to create this feature surrounding that platform.

I think because this was associated to the fpaste utility, the Fedora pastebin site is now maintained by the Red Hat Community Platform Engineering (CPE) team under the centos.org domain:

https://paste.centos.org/api

So, we could use the CentOS pastebin API.

@nasirhm:
I would like to work on it.

Awesome, thanks for your interest @nasirhm! 🙌 How are you thinking to approach the implementation? Any thoughts?

@nasirhm
Copy link

nasirhm commented Jun 14, 2020

@jwflory
Awesome, thanks for your interest @nasirhm! raised_hands How are you thinking to approach the >implementation? Any thoughts?

I'm setting up the development environment first, after that would try to go through the code and on the approach to implement this is what i think:

  • A user from the TG side types a message.
  • If the message had \n character in it, we can send complete text to the paste.centos.org API and send the link instead.

It's a pretty basic abstraction of how I would approach the problem. What do you think ?

@jwflory
Copy link
Member

jwflory commented Jun 24, 2020

@nasirhm This is good. Initially I was thinking it would be better to count the number of characters up to the max message length permitted for IRC. I think \n should actually create multi-line messages, but if a particular line is longer than the permitted IRC message max, then that line should go to a pastebin service.

Does this explanation make sense? Curious what other @RITlug/teleirc-developers-commit-access folks think.

@kennedy
Copy link
Contributor

kennedy commented Jun 24, 2020

I think the irc message size limit is around 510 characters + 2 command characters. anything bigger definite should be a pastebin.

I often have multiline replies on telegram, and doesn't seem appropriate to auto-assume a pastebin for new lines.

like this reply is 321 characters, i think is fine without a pastebin

@nasirhm
Copy link

nasirhm commented Jun 24, 2020

I've got the idea of what to implement, Thanks @jwflory and @kennedy

For utilizing CentOS Paste : We would require an API_KEY to create the paste and i am unable to find a way to generate the API Key.

Any other pastebin service with a decent API would work wonders too. What do you guys think ?

@jwflory
Copy link
Member

jwflory commented Jun 24, 2020

@nasirhm Looks like there might be a single key used across the entire CentOS Pastebin Service (see here). I don't think we want all of our users to ask Fedora Infrastructure for the single key…

So, any other service is fine. I think it is a requirement that it be an open source pastebin tool with self-hosting options, for other downstream TeleIRC users. This way, they could also configure a different base URL if a downstream TeleIRC User wanted to use their own internally-hosted Pastebin Service.

@Tjzabel Tjzabel changed the title Multiline Telegram messages should go on pastebin Large Telegram messages should go on pastebin Jun 30, 2020
@Tjzabel
Copy link
Member

Tjzabel commented Jun 30, 2020

@nasirhm hello!

I reworded this issue to specify large TG messages. What we did in the previous iterations of TeleIRC is made all newlines within a TG message still fall under the same IRC message, so that way a 5-line TG message still gets sent to IRC as a single message. Additionally, we had a maximum message limit, and split out large messages that went over this limit into separate messages.

As we don't currently have this feature implemented in Golang (v2.0+), we can turn this issue into two parts:

  1. Newlines (\n) get captured to send multiline messages as a single IRC message, instead of having them all individual
  2. Very large messages (maybe over 500 chars?) go onto a pastebin instead, regardless of newlines

These two points would be separate blocks of work (and thus separate issues/PRs), but would ultimately work together. Thoughts?

@nasirhm
Copy link

nasirhm commented Jul 22, 2020

Hey @Tjzabel Thanks for the update, I've been a little busier in the past days and now am back. The very large messages sounds good to me.

@jwflory what do you think about over 500 chars ?

@jwflory
Copy link
Member

jwflory commented Jul 23, 2020

+1, I am on board. 😄

@nasirhm
Copy link

nasirhm commented Jul 23, 2020

@jwflory /me is working on it now.

@tyll
Copy link

tyll commented Oct 18, 2021

This seems to be too complicated for a "good first issue" as listed in https://fedoraproject.org/easyfix/ please consider removing it.

@robbyoconnor
Copy link
Contributor

robbyoconnor commented Oct 18, 2021

I don't agree, this isn't that insanely complex. It requires knowledge of how both Telegram and IRC work and then it's a matter of checking the message length and making a request to a pastebin service via an API.

@robbyoconnor
Copy link
Contributor

IMHO this is PERFECT for Hacktoberfest. Hacktoberfest is about getting good quality PRs and this is good for that.

@jwflory jwflory modified the milestones: v2.2.1, v2.x.x Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Anyone is welcome to help us with this! improvement Improves on something that already exists
Projects
Development

No branches or pull requests

8 participants
@robbyoconnor @tyll @kennedy @mxa @jwflory @Tjzabel @nasirhm and others