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

Translate photos from Telegram as links #99

Merged
merged 1 commit into from
Apr 5, 2020

Conversation

gsomix
Copy link
Contributor

@gsomix gsomix commented Feb 25, 2020

Closes #26

Unresolved questions:

  1. Should we support content of any type, not only images?
  2. How to format messages and links?
  3. Are there any methods to get links that can be opened in Russia?

@ForNeVeR @Minoru What do you think? Thanks!

let private getMessageBodyText (message: FunogramMessage) =
let text =
match message with
| { Text = Some text } -> applyEntities message.Entities text
| { Caption = Some caption } ->
let caption = applyEntities message.CaptionEntities caption
sprintf "[Content with caption \"%s\"]" caption
sprintf "%s\n%s" caption (getLinkToMessage message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new format is easy to mistake for a genuine message. Also, I'd keep the URL on the same line, because vertical space is scarce on wide monitors, and links are only useful if the caption is interesting. So I suggest a mix of the old and new formats: [Content with caption \"%s\", %s]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a reason why we don't usually put any links near typographic like , or ]: some XMPP clients like to include these characters into the link body, and break the link in the process.

Yet, this format would be really easy to mistake for a geniune message. I suggest the following:
[Content with caption "%s"]: %s

This probably has a bit awkward typographics, but solves all the mentioned problems.

@Minoru
Copy link
Member

Minoru commented Feb 25, 2020

Should we support content of any type, not only images?

Пусть Эндер сам свои войсы слушает. :P

On a serious note, what types are available? Voice and video messages?

@gsomix
Copy link
Contributor Author

gsomix commented Feb 25, 2020

@Minoru Video, audio, GIFs, and files.

@Minoru
Copy link
Member

Minoru commented Feb 25, 2020

I don't see any reason to support one type and not support the other, so: support all of them, in the same way? Or is there some type-specific gotchas that make this impossible?

@ForNeVeR
Copy link
Member

ForNeVeR commented Feb 26, 2020

Voice messages are banned for Mr. Ender, you shouldn't worry about that.

I agree that we should import all the available content. I'm not aware of alternative content sources, so probably users should use VPN if they're under Russian restrictions. This is rather unfortunate, but our life is too.

@ForNeVeR ForNeVeR self-assigned this Mar 22, 2020
@gsomix gsomix force-pushed the feature/links-to-images branch 2 times, most recently from bcfb481 to 8b935df Compare March 28, 2020 06:44
@gsomix gsomix changed the title [WIP] Translate images from Telegram as links Translate content from Telegram as links Mar 28, 2020
@gsomix gsomix force-pushed the feature/links-to-images branch from 8b935df to 8f2a64e Compare March 28, 2020 07:32
@gsomix gsomix changed the title Translate content from Telegram as links Translate photos from Telegram as links Mar 28, 2020
@ForNeVeR ForNeVeR mentioned this pull request Apr 5, 2020
6 tasks
Copy link
Member

@ForNeVeR ForNeVeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help on that. I've filed #102 with further content experience improvements, but let's test this system for now.

@ForNeVeR
Copy link
Member

ForNeVeR commented Apr 5, 2020

A side note: Travis is being shitty again, as usual.

@ForNeVeR ForNeVeR merged commit 8f2a64e into codingteam:master Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide an URL for attached images from Telegram
3 participants