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 support for zm.page links #731

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "zm_page_icon.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions MeetingBar/MeetingServices.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ enum MeetingServices: String, Codable, CaseIterable {
case pumble = "Pumble"
case suitConference = "Suit Conference"
case doxyMe = "Doxy.me"
case zmPage = "zm.page"
case other = "Other"

var localizedValue: String {
Expand Down Expand Up @@ -321,6 +322,7 @@ struct LinksRegex {
let pumble = try! NSRegularExpression(pattern: #"https?://meet\.pumble\.com/[a-z-]+"#)
let suitConference = try! NSRegularExpression(pattern: #"https?://([a-z0-9.]+)?conference\.istesuit\.com/[^\s]*+"#)
let doxyMe = try! NSRegularExpression(pattern: #"https://([a-z0-9.]+)?doxy\.me/[^\s]*"#)
let zmPage = try! NSRegularExpression(pattern: #"https?://([a-zA-Z0-9.]+)\.zm\.page"#)
}

func getRegexForMeetingService(_ service: MeetingServices) -> NSRegularExpression? {
Expand Down Expand Up @@ -607,6 +609,10 @@ func getIconForMeetingService(_ meetingService: MeetingServices?) -> NSImage {
image = NSImage(named: "doxy_me_icon")!
image.size = NSSize(width: 16, height: 16)

case .some(.zmPage):
image = NSImage(named: "zm_page_icon")!
image.size = NSSize(width: 16, height: 16)

// tested and verified
case .none:
image = NSImage(named: "no_online_session")!
Expand Down
3 changes: 2 additions & 1 deletion MeetingBarTests/MeetingServicesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ let meetings = [
MeetingLink(service: .tuple, url: URL(string: "https://tuple.app/c/V1StGXR8_Z5jdHi6B")!),
MeetingLink(service: .pumble, url: URL(string: "https://meet.pumble.com/vly-hggs-xsn")!),
MeetingLink(service: .suitConference, url: URL(string: "https://turkcell.conference.istesuit.com/username")!),
MeetingLink(service: .doxyMe, url: URL(string: "https://bbc.doxy.me/dr.who")!)
MeetingLink(service: .doxyMe, url: URL(string: "https://bbc.doxy.me/dr.who")!),
MeetingLink(service: .zmPage, url: URL(string: "https://meetingbar.zm.page")!)
]

class MeetingServicesTests: XCTestCase {
Expand Down
13 changes: 13 additions & 0 deletions MeetingBarTests/Meetingbar-sample-data.ics
Original file line number Diff line number Diff line change
Expand Up @@ -409,4 +409,17 @@ DTSTART;TZID=Europe/Berlin:20201225T203000
SEQUENCE:1
DESCRIPTION:https://go.teamviewer.com/v15/m212323
END:VEVENT
BEGIN:VEVENT
CREATED:20240601T165407Z
UID:F012139F-5ED4-4617-8943-EBD0460D79ED
DTEND;TZID=Europe/Berlin:20240601T213000
TRANSP:OPAQUE
X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
SUMMARY:ZM Page Test
LAST-MODIFIED:20240601T165434Z
DTSTAMP:20240601T165435Z
DTSTART;TZID=Europe/Berlin:20240601T203000
SEQUENCE:1
DESCRIPTION:https://meetingbar.zm.page
END:VEVENT
END:VCALENDAR
Loading