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

use clipboard hack to get deferred deeplink #7842

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

fedrunov
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

When a user follows a matrix.to link on mobile, it doesn't work because the app does not keep the link. Storing the link in the clipboard means it can be pasted to ensure the user reaches the room they intended to...

This is draft PR since it's blocked by

matrix-org/matrix.to#297

Motivation and context

closes #7673

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@fedrunov fedrunov requested a review from bmarty December 23, 2022 12:09
@ElementBot
Copy link

Warnings
⚠️

Please add a changelog. See instructions here

Generated by 🚫 dangerJS against 2dc103f

interface DeferredPermalinkService {

/**
* Checks system clipboard for matrix.to links and returns first room link if any found

Choose a reason for hiding this comment

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

  • ⚠️ The first sentence of this KDoc does not end with the correct punctuation.


package org.matrix.android.sdk.internal.session.permalinks

import android.content.ClipboardManager

Choose a reason for hiding this comment

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

  • 🚫 Imports must be ordered in lexicographic order without any empty lines in-between with "java", "javax", "kotlin" and aliases in the end

@ElementBot
Copy link

Warnings
⚠️

Please add a changelog. See instructions here

Generated by 🚫 dangerJS against 03be469

@sonarcloud
Copy link

sonarcloud bot commented Dec 23, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Some thoughts.

/**
* Returns the deferredPermalinkService service associated with the session.
*/
fun deferredPermalinkService(): DeferredPermalinkService
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure to understand why this code is on the SDK side. It should be at the application level.

@@ -293,6 +293,7 @@ class HomeActivityViewModel @AssistedInject constructor(
.onEach { status ->
when (status) {
is SyncRequestState.Idle -> {
checkDeferredPermalink()
Copy link
Member

Choose a reason for hiding this comment

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

What is preventing this to be executed at each start (i.e. until the Clipboard is flushed?)

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


NIkita Fedrunov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Implement the clipboard hack for matrix.to links
4 participants