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

Add a capability for the reference API and expose the regex to clients #34350

Merged

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Sep 30, 2022

Fix #34278

{
  "ocs": {
    "meta": {
      "status": "ok",
      "statuscode": 200,
      "message": "OK"
    },
    "data": {
      "version": {
        "major": 26,
        "minor": 0,
        "micro": 0,
        "string": "26.0.0 dev",
        "edition": "",
        "extendedSupport": false
      },
      "capabilities": {
        "core": {
          "pollinterval": 60,
          "webdav-root": "remote.php/webdav",
          "reference-api": true,
          "reference-regex": "(\\s|\\n|^)(https?:\\/\\/)((?:[-A-Z0-9+_]+\\.)+[-A-Z]+(?:\\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\\s|\\n|$)"
        },

@nickvergessen nickvergessen added bug 3. to review Waiting for reviews labels Sep 30, 2022
@nickvergessen nickvergessen added this to the Nextcloud 26 milestone Sep 30, 2022
@nickvergessen nickvergessen self-assigned this Sep 30, 2022
@nickvergessen nickvergessen requested review from ArtificialOwl, blizzz and CarlSchwan and removed request for a team September 30, 2022 16:17
@nickvergessen
Copy link
Member Author

/backport to stable25

@mahibi
Copy link

mahibi commented Oct 1, 2022

for kotlin /mi is not supported.

So i have to use
"(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)"
instead of
"/(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)/mi"

and do
regexString.toRegex(setOf(RegexOption.MULTILINE, RegexOption.IGNORE_CASE))

Could we maybe return the regex from capabilities without /mi ?
@nickvergessen @SystemKeeper

@SystemKeeper
Copy link
Contributor

So i have to use
"(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)"

Same for me. I quickly tested using the regex yesterday, but haven't put too much time into it (current implementation just uses the apple link detection lib)

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the bugfix/34278/add-capability-for-the-reference-api branch from dcd34d8 to d434da7 Compare October 1, 2022 16:24
@nickvergessen
Copy link
Member Author

Adjusted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add capability for reference metadata fetching for mobile clients
4 participants