Add support for telegram chat links opening#397
Draft
krlade wants to merge 4 commits intopaper-plane-developers:mainfrom
Draft
Add support for telegram chat links opening#397krlade wants to merge 4 commits intopaper-plane-developers:mainfrom
krlade wants to merge 4 commits intopaper-plane-developers:mainfrom
Conversation
melix99
reviewed
Nov 2, 2022
Contributor
Author
9cc8459 to
c34870f
Compare
melix99
requested changes
Nov 4, 2022
melix99
requested changes
Nov 4, 2022
Contributor
Author
|
It's ready for the review. I rewrite my code using official API this time 😁 |
krlade
commented
Mar 10, 2023
melix99
reviewed
Mar 10, 2023
| 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 { |
Collaborator
There was a problem hiding this comment.
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.
melix99
reviewed
Mar 10, 2023
| if let Ok(link_type) = result { | ||
| use enums::InternalLinkType::*; | ||
| // TODO: Support other link types | ||
| #[allow(clippy::single_match)] |
Collaborator
There was a problem hiding this comment.
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 :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.