Skip to content

Commit

Permalink
Added support for Cal Video links
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikTo committed Jun 10, 2024
1 parent 2540165 commit f712966
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "calcom_icon.png",
"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 calcom = "Cal Video"
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 calcom = try! NSRegularExpression(pattern: #"https?://app.cal\.com/video/[A-Za-z0-9./]+"#)
}

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

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

case .some(.url):
image = NSImage(named: NSImage.touchBarOpenInBrowserTemplateName)!
image.size = NSSize(width: 16, height: 16)
Expand Down
1 change: 1 addition & 0 deletions MeetingBarTests/MeetingServicesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ let meetings = [
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")!)

Check failure on line 44 in MeetingBarTests/MeetingServicesTests.swift

View workflow job for this annotation

GitHub Actions / Tests

expected ',' separator

Check failure on line 44 in MeetingBarTests/MeetingServicesTests.swift

View workflow job for this annotation

GitHub Actions / Tests

expected ',' separator
MeetingLink(service: .calcom, url: URL(string: "https://app.cal.com/video/1de4BmdXEb983kIUHomUnA")!)
]

class MeetingServicesTests: XCTestCase {
Expand Down

0 comments on commit f712966

Please sign in to comment.