-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add support for telegram chat links opening #397
base: main
Are you sure you want to change the base?
Conversation
9cc8459
to
c34870f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing, I usually prefer to have commits grouped per feature. In your case you divided them for single file, which is not that useful, so please squash them into a single one.
It's ready for the review. I rewrite my code using official API this time 😁 |
pub(crate) fn handle_telegram_link(&self, link: String) { | ||
let client_id = self.active_logged_in_client_id(); | ||
if let Some(client_id) = client_id { | ||
spawn(clone!(@weak self as obj => async move { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having all these spawn calls, I think it's better to have this whole function (and open_chat_by_username
) async and then having the callers of this function to spawn a future to execute it.
if let Ok(link_type) = result { | ||
use enums::InternalLinkType::*; | ||
// TODO: Support other link types | ||
#[allow(clippy::single_match)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to do that, just follow what clippy says. I know that we'll need a match arm in the future, but I prefer not ignore clippy :)
Add support for telegram links opening, fixes #253
For now it only works when the app is already opened, but this might be changed once #4 is completed.