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

New feature link preview #109

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

phofmeier
Copy link

Overview

Added feature to wait for a Link Preview.

Successfully tested with Chrome Browser and Chrome-Driver 110.0.5481.77
Not tested with anything else.

Related to Issue #25

Implementation

  • A link preview appears above the text input if a link is part of the message.
  • A function was added which waits until the height of the preview is bigger than 0.
    • Height is polled every second until it is bigger than 0 or a timeout occurs.
  • After a timeout the message is sent even if no preview appears.
  • Waiting for this preview is disabled by default and can be enabled with a flag insend_message and send_direct_message

Copy link
Owner

@Kalebu Kalebu left a comment

Choose a reason for hiding this comment

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

This is cool @phofmeier

I see here you on the wait_for_link_preview(self, timeout=30) method, The timeout time to wait for the preview is configurable but you haven't provided the same flexibility when it's getting called in send_message() or send_direct_message() where the only configurable parameter is whether to enable or disable it.

Also Just to clarify is there some test you've run to make the 30s the default time to wait for the preview to show?

@pramadhana92
Copy link

It's working, thanks @phofmeier ! :)

Now the timeout for the link preview can be set as a functin argument.
@phofmeier
Copy link
Author

This is cool @phofmeier

I see here you on the wait_for_link_preview(self, timeout=30) method, The timeout time to wait for the preview is configurable but you haven't provided the same flexibility when it's getting called in send_message() or send_direct_message() where the only configurable parameter is whether to enable or disable it.

Also Just to clarify is there some test you've run to make the 30s the default time to wait for the preview to show?

I changed the argument to provide access to change the timeout.

The time needed seams to be depending on the link and the used system. On my Andorid phone it most time needs around 5s and on IOS 1s. It looks like there is no good default value to provide.

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.

3 participants