Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions MeetingBar/Core/EventStores/GCEventStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,16 @@ final class GCEventStore: NSObject,
}
}

var meetingNotesDocLink: URL?
if let attachments = item["attachments"] as? [[String: Any]] {
if let docAttachment = attachments.first(where: {
($0["mimeType"] as? String) == "application/vnd.google-apps.document"
|| (($0["fileUrl"] as? String)?.contains("docs.google.com") ?? false)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we should of course generalize this eventually to notion / other methods

}) {
meetingNotesDocLink = URL(string: docAttachment["fileUrl"] as? String ?? "")
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

let organizerRaw = item["organizer"] as? [String: String]
let organizer = MBEventOrganizer(email: organizerRaw?["email"], name: organizerRaw?["name"])

Expand Down Expand Up @@ -463,6 +473,7 @@ final class GCEventStore: NSObject,
notes: notes,
location: location,
url: url,
meetingNotesDocLink: meetingNotesDocLink,
organizer: organizer,
attendees: attendees,
startDate: startDate,
Expand Down
8 changes: 8 additions & 0 deletions MeetingBar/Core/Models/MBEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public struct MBEvent: Identifiable, Hashable, Sendable {
public var status: MBEventStatus
public var participationStatus: MBEventAttendeeStatus = .unknown
public var meetingLink: MeetingLink?
public var meetingNotesDocLink: URL?
public var organizer: MBEventOrganizer?
public let url: URL?
public let notes: String?
Expand All @@ -79,6 +80,7 @@ public struct MBEvent: Identifiable, Hashable, Sendable {
notes: String?,
location: String?,
url: URL?,
meetingNotesDocLink: URL? = nil,
organizer: MBEventOrganizer?,
attendees: [MBEventAttendee] = [],
startDate: Date,
Expand All @@ -105,6 +107,7 @@ public struct MBEvent: Identifiable, Hashable, Sendable {
self.notes = notes
self.location = location
self.url = url
self.meetingNotesDocLink = meetingNotesDocLink

self.organizer = organizer
self.attendees = attendees
Expand Down Expand Up @@ -162,6 +165,11 @@ public struct MBEvent: Identifiable, Hashable, Sendable {
}
}
openMeetingURL(meetingLink.service, meetingLink.url, nil)
if Defaults[.openGoogleMeetingNotesOnJoin],
meetingLink.service == .meet,
let notesURL = meetingNotesDocLink {
notesURL.openInDefaultBrowser()
}
} else if let eventUrl = url {
eventUrl.openInDefaultBrowser()
} else {
Expand Down
1 change: 1 addition & 0 deletions MeetingBar/Extensions/DefaultsKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ extension Defaults.Keys {
static let createMeetingServiceUrl = Key<String>("createMeetingServiceUrl", default: "")

static let meetBrowser = Key<Browser>("meetBrowser", default: systemDefaultBrowser)
static let openGoogleMeetingNotesOnJoin = Key<Bool>("openGoogleMeetingNotesOnJoin", default: false)
static let zoomBrowser = Key<Browser>("zoomBrowser", default: systemDefaultBrowser)
static let teamsBrowser = Key<Browser>("teamsBrowser", default: systemDefaultBrowser)
static let jitsiBrowser = Key<Browser>("jitsiBrowser", default: systemDefaultBrowser)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@

"preferences_services_link_meeting_title" = "Open all meeting links in";
"preferences_services_link_service_title" = "Open %@ links in";
"preferences_services_meet_open_notes_on_join" = "Open attached Google Doc notes when joining";
"preferences_services_link_default_browser_value" = "Default web browser";
"preferences_services_supported_links_list" = "Supported links for services:\n%@";
"preferences_services_supported_links_mailback" = "If the service you use isn't supported, you can send an e-mail to the developers";
Expand Down
4 changes: 4 additions & 0 deletions MeetingBar/UI/Views/Preferences/LinksTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import SwiftUI

struct LinksTab: View {
@Default(.meetBrowser) var meetBrowser
@Default(.openGoogleMeetingNotesOnJoin) var openGoogleMeetingNotesOnJoin
@Default(.browserForCreateMeeting) var browserForCreateMeeting
@Default(.defaultBrowser) var defaultBrowser
@Default(.zoomBrowser) var zoomBrowser
Expand Down Expand Up @@ -56,6 +57,9 @@ struct LinksTab: View {
}
}

Toggle("preferences_services_meet_open_notes_on_join".loco(), isOn: $openGoogleMeetingNotesOnJoin)
.frame(maxWidth: .infinity, alignment: .leading)

Picker(
selection: $zoomBrowser,
label: Text("preferences_services_link_service_title".loco("Zoom")).frame(
Expand Down
Loading