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 e66a6a8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
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
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: .calcom, url: URL(string: "https://app.cal.com/video/1de4BmdXEb983kIUHomUnA")!)
]

class MeetingServicesTests: XCTestCase {
Expand Down

0 comments on commit e66a6a8

Please sign in to comment.