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

Video link displayed twice, first one with ?theater #187

Closed
Smile4ever opened this issue Dec 29, 2015 · 1 comment
Closed

Video link displayed twice, first one with ?theater #187

Smile4ever opened this issue Dec 29, 2015 · 1 comment

Comments

@Smile4ever
Copy link

Here I am again.

I found another case of duplicate messages: video links. I'm not sure if you want to solve it though:
(15:54:07) person: https://www.facebook.com/1420819151499426/videos/1714252692156069/?theater
(15:54:07) person: https://www.facebook.com/1420819151499426/videos/1714252692156069/

First link is the same with ?theater, next link is the same without ?theater.

The parameter ?theater has no effect. This is due to thumbnails displaying.

You can solve all these thumbnail issues all at once, I believe:

  • if you receive a message, check if the previous message is from facebook and contains a question mark.
  • if so, find the position of the question mark
  • if not from facebook, but it is still an url, just do the compare on the last char of the link (the char before \n or the char before the space)
  • do a substring on the previous message from the start of "http" to the question mark
  • if that substring is equal to the current message, do not add the current message (the URL without question mark) to the conversation window

I believe this covers almost all cases, including this one:
(16:07:29) Smile4ever: look at this :p https://www.facebook.com/1420819151499426/videos/1714252692156069/?theater
(16:07:29) Smile4ever: https://www.facebook.com/1420819151499426/videos/1714252692156069/
(as you can see, the substring starting with http is equal to the next message)

This is the opposite approach of what you once suggested (you suggested removing the parameters from the URL, but objected because they are sometimes needed).

Looking forward to your reaction.

@dequis
Copy link
Owner

dequis commented Jan 4, 2017

0.9.0

@dequis dequis closed this as completed Jan 4, 2017
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

No branches or pull requests

2 participants