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

Support all threema url actions #215

Merged
merged 3 commits into from
May 8, 2017
Merged

Support all threema url actions #215

merged 3 commits into from
May 8, 2017

Conversation

dbrgn
Copy link
Contributor

@dbrgn dbrgn commented May 4, 2017

  • Add UriService with parseQueryParams function
  • Refactor ThreemaAction directive
  • Add support for compose directive

I tested various combinations of predefined compose text, drafts, clicking on back button and clicking on other conversations. I hope I didn't miss some edge case. If a draft is defined, it's overwriten, but when pushing the back button in the header without typing anything, the draft should be restored when going back to the conversation.

Fixes #190.

@dbrgn dbrgn requested a review from sillych May 4, 2017 20:34
@rugk
Copy link
Contributor

rugk commented May 4, 2017

So how did you finally do it? (Just give the ones an overview, who do not want to dive into the code.)
Using WebWorkers or some other messaging method or how exactly?
Or do you support web-threema:// URIs or so?

@IndianaDschones
Copy link
Contributor

@rugk The url actions are only supported/handled inside Threema Web for sent and received messges.

I also tried to click threema://add-Links on different websites and nothing happened. Then i read the issue again, especially this comment from dbrgn where he said

I'll add support for the compose action from within Threema Web though.

};

const getThreemaActionHandler = (name: string) => {
switch (name) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Query parameters should be case-insensitve 😉
This could be solved using name.toLowerCase()

&& node.tagName.toLowerCase() === 'a') {

const link = (node as HTMLElement).innerText;
if (link !== undefined && link.startsWith('threema://')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as my first comment. Protocol should also be case-insensitive

@dbrgn dbrgn merged commit 2b4dd78 into master May 8, 2017
@dbrgn dbrgn deleted the issue-190 branch May 8, 2017 14:38
@rugk
Copy link
Contributor

rugk commented May 8, 2017

Great, that's at least somehow, although it of course does not fulfil #190 completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants