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

Incorrect Microsoft Teams Link Detection in MeetingBar #755

Open
acamposhd opened this issue Aug 7, 2024 · 1 comment
Open

Incorrect Microsoft Teams Link Detection in MeetingBar #755

acamposhd opened this issue Aug 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@acamposhd
Copy link

Summary:

MeetingBar is selecting the incorrect Microsoft Teams link by default. The application should prioritize the link that opens directly to the meeting rather than the one that only opens the Teams app.

Steps to Reproduce:

Schedule a job event with two Microsoft Teams links.
Ensure one link opens directly to the meeting (https://teams.microsoft.com/l/meetup-join/...) and the other link opens the Teams app.
Add the event to MeetingBar.

Expected Behavior:

MeetingBar should identify and open the link that takes you directly to the meeting, represented by the URL pattern:

https://teams.microsoft.com/l/meetup-join/19%3ameeting_[^\/]+/0\?context=%7b%22Tid%22%3a[^&]+%7d

The correct link should also display the Teams icon.

Actual Behavior:

MeetingBar defaults to the link that opens just the Teams app, resulting in the user having to manually navigate to the meeting. Furthermore, when using the regex workaround, the Teams icon does not display as expected.

Notes:

The regex provided successfully identifies the correct meeting link, but it doesn't render the Teams icon as expected.

@dosubot dosubot bot added the bug Something isn't working label Aug 7, 2024
Copy link

dosubot bot commented Aug 7, 2024

Hey there, @acamposhd! 👋 I'm here to help you with any bugs, questions, or contributions you have in mind. Let's tackle this issue together!

To address the issue of MeetingBar selecting the incorrect Microsoft Teams link, you need to ensure that the application prioritizes the link that opens directly to the meeting. Here's how you can configure MeetingBar to achieve this:

  1. Set the Default Browser for Teams Links:
    Ensure that the TeamsAppBrowser is not set as the default browser for Teams meetings. Instead, set a standard web browser as the default. This can be done by changing the Defaults[.teamsBrowser] setting to a web browser other than TeamsAppBrowser.

    Defaults[.teamsBrowser] = .defaultBrowser // or any other web browser you prefer
  2. Modify the Link Detection Logic:
    MeetingBar parses and stores multiple links from a single calendar event by checking several fields: location, url, notes, and notes with HTML tags stripped. The first detected meeting link is stored in the meetingLink property. Ensure that the regex pattern for the direct meeting link is prioritized.

    let linkFields = [
        location,
        url?.absoluteString,
        notes,
        notes?.htmlTagsStripped()
    ].compactMap { $0 }
    
    for linkField in linkFields {
        if var detectedLink = detectMeetingLink(linkField) {
            if detectedLink.service == .meet,
               let account = calendar.email,
               let urlEncodedAccount = account.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
                detectedLink.url = URL(string: (detectedLink.url.absoluteString) + "?authuser=\(urlEncodedAccount)")!
            }
            meetingLink = detectedLink
            break
        }
    }
  3. Custom Regex for Identifying Links:
    You can define custom regex patterns for identifying meeting links under the "Advanced" preferences tab. This allows you to add, edit, and save custom regex patterns for meeting links.

    "preferences_advanced_regex_title" = "Custom regex for meeting link";
    "preferences_advanced_regex_add_button" = "Add regex";
    "preferences_advanced_regex_edit_button" = "Edit";
    "preferences_advanced_regex_new_title" = "Enter regex";
    "preferences_advanced_regex_new_cant_save_title" = "Cannot save regex";
    
  4. Display the Correct Icon:
    To ensure the correct icon is displayed for the Teams link, modify the getIconForMeetingService function to use the appropriate image name for the Teams case.

    func getIconForMeetingService(_ meetingService: MeetingServices?) -> NSImage {
        var image = NSImage(named: "no_online_session")!
        image.size = NSSize(width: 16, height: 16)
    
        switch meetingService {
        case .some(.teams):
            image = NSImage(named: "ms_teams_icon")!
            image.size = NSSize(width: 16, height: 16)
        default:
            break
        }
    
        return image
    }

By following these steps, MeetingBar should correctly identify and prioritize the Microsoft Teams link that opens directly to the meeting and display the appropriate icon [1][2][[3]](https://github.com/leits/MeetingBar/blob/master/MeetingBar/Resources /Localization /en.lproj/Localizable.strings).

To continue talking to Dosu, mention @dosu.

GitHub
🇺🇦 Your meetings at your fingertips in the macOS menu bar - File not found · leits/MeetingBar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant