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

feat(API): Allow to block older clients #9632

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented May 26, 2023

☑️ Resolves

  • API throws an exception and returns with a 426 Upgrade Required status code

🚧 Tasks

🏁 Checklist

Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Everything looks great for me.

What do you think about adding the min required version to the response?

Comment on lines +48 to +67
/**
* Talk Desktop user agent but with a regex match for the version
* @see IRequest::USER_AGENT_TALK_DESKTOP
*/
public const USER_AGENT_TALK_DESKTOP = '/^Mozilla\/5\.0 \((?!Android|iOS)[A-Za-z ]+\) Nextcloud-Talk v([^ ]*).*$/';
public const TALK_DESKTOP_MIN_VERSION = '0.6.0';

/**
* Talk Android user agent but with a regex match for the version
* @see IRequest::USER_AGENT_TALK_ANDROID
*/
public const USER_AGENT_TALK_ANDROID = '/^Mozilla\/5\.0 \(Android\) Nextcloud\-Talk v([^ ]*).*$/';
public const TALK_ANDROID_MIN_VERSION = '15.0.0';

/**
* Talk iOS user agent but with a regex match for the version
* @see IRequest::USER_AGENT_TALK_IOS
*/
public const USER_AGENT_TALK_IOS = '/^Mozilla\/5\.0 \(iOS\) Nextcloud\-Talk v([^ ]*).*$/';
public const TALK_IOS_MIN_VERSION = '15.0.0';
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also update IRequest REs for version support in the server?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's see what others think: nextcloud/server#38561

lib/Middleware/CanUseTalkMiddleware.php Outdated Show resolved Hide resolved
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Good to me after an update too, thanks for adding a version to the message.

Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Good to me after an update too, thanks for adding a version to the message.

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the feat/desktop-201/allow-to-block-older-clients branch from 6183be4 to d0ca6ec Compare June 1, 2023 04:35
@nickvergessen nickvergessen merged commit 13e02a4 into master Jun 1, 2023
@nickvergessen nickvergessen deleted the feat/desktop-201/allow-to-block-older-clients branch June 1, 2023 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release enhancement feature: api 🛠️ OCS API for conversations, chats and participants
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants