Skip to content

Commit

Permalink
Merge branch 'master' into Support-zoom.com-links
Browse files Browse the repository at this point in the history
  • Loading branch information
leits authored Jan 6, 2024
2 parents 4d55940 + 6c9228d commit 5769084
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 37 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ jobs:
Tests:
runs-on: macOS-latest
steps:
- name: "Select Xcode 13.0.0"
uses: devbotsxyz/xcode-select@v1
- uses: actions/checkout@v3

- name: Xcode Select Version
uses: mobiledevops/xcode-select-version-action@v1
with:
version: "13"
- uses: actions/checkout@v1
xcode-select-version: 14.2

- name: Install xcbeautify
run: brew install xcbeautify

- name: Run unit tests
run: xcodebuild -scheme MeetingBar test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcbeautify
18 changes: 11 additions & 7 deletions MeetingBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
4654E66227F24A3F001848AB /* Protocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4654E66127F24A3F001848AB /* Protocol.swift */; };
4672B58229C130160055E7D7 /* AppIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4672B58129C130160055E7D7 /* AppIntent.swift */; };
467351B729057BC900EE3987 /* StringExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 467351B629057BC900EE3987 /* StringExtensionsTests.swift */; };
46B0E9692A78340B00C936DB /* AutoJoinScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46B0E9682A78340B00C936DB /* AutoJoinScreen.swift */; };
46E4794C2801D53B00B48059 /* MeetingServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E4794B2801D53B00B48059 /* MeetingServices.swift */; };
46E4794E2802141800B48059 /* Calendar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E4794D2802141800B48059 /* Calendar.swift */; };
46E479502802155700B48059 /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E4794F2802155700B48059 /* Event.swift */; };
Expand Down Expand Up @@ -116,6 +117,7 @@
4654E66127F24A3F001848AB /* Protocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Protocol.swift; sourceTree = "<group>"; };
4672B58129C130160055E7D7 /* AppIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIntent.swift; sourceTree = "<group>"; };
467351B629057BC900EE3987 /* StringExtensionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringExtensionsTests.swift; sourceTree = "<group>"; };
46B0E9682A78340B00C936DB /* AutoJoinScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoJoinScreen.swift; sourceTree = "<group>"; };
46E4794B2801D53B00B48059 /* MeetingServices.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeetingServices.swift; sourceTree = "<group>"; };
46E4794D2802141800B48059 /* Calendar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Calendar.swift; sourceTree = "<group>"; };
46E4794F2802155700B48059 /* Event.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Event.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -190,26 +192,26 @@
144C017B2462D0C3000C9FFC /* MeetingBar */ = {
isa = PBXGroup;
children = (
E26A0BFB263449E300F117A9 /* Scripts.swift */,
4672B58129C130160055E7D7 /* AppIntent.swift */,
1BF37A902604C8050053D53C /* Resources */,
144C017C2462D0C3000C9FFC /* AppDelegate.swift */,
1452C9AD25AF5B1000C46CDF /* Views */,
46E4794A2801D4BD00B48059 /* EventStores */,
149AD20F25A8967C004976F1 /* Extensions */,
144C017C2462D0C3000C9FFC /* AppDelegate.swift */,
140D84312493A3FE0055E1CE /* StatusBarItemController.swift */,
140D84332493A4180055E1CE /* Constants.swift */,
01044AE027EA695A0070512E /* ActionsOnEventStart.swift */,
4672B58129C130160055E7D7 /* AppIntent.swift */,
E26A0BFB263449E300F117A9 /* Scripts.swift */,
14C59B8425CF45340019C9E4 /* AppStore.swift */,
140D84392493A6240055E1CE /* Helpers.swift */,
1BF37AA42604F7E00053D53C /* I18N.swift */,
14879B2A24E6889C00DB0A7E /* Notifications.swift */,
46E4794B2801D53B00B48059 /* MeetingServices.swift */,
46E4794A2801D4BD00B48059 /* EventStores */,
149AD20F25A8967C004976F1 /* Extensions */,
144C01822462D0C5000C9FFC /* Preview Content */,
144C01852462D0C5000C9FFC /* Main.storyboard */,
144C01882462D0C5000C9FFC /* Info.plist */,
144C01802462D0C5000C9FFC /* Assets.xcassets */,
144C01892462D0C5000C9FFC /* MeetingBar.entitlements */,
1BF37AA42604F7E00053D53C /* I18N.swift */,
01044AE027EA695A0070512E /* ActionsOnEventStart.swift */,
);
path = MeetingBar;
sourceTree = "<group>";
Expand All @@ -229,6 +231,7 @@
1452C9B225AF5C6F00C46CDF /* Preferences */,
1452C9B325AF5C7D00C46CDF /* Onboarding */,
1452C9BB25AF5D8700C46CDF /* Shared.swift */,
46B0E9682A78340B00C936DB /* AutoJoinScreen.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -501,6 +504,7 @@
buildActionMask = 2147483647;
files = (
1452C9D825AF889A00C46CDF /* WelcomeScreen.swift in Sources */,
46B0E9692A78340B00C936DB /* AutoJoinScreen.swift in Sources */,
1452C9BC25AF5D8700C46CDF /* Shared.swift in Sources */,
1435E44C260954D00071B188 /* Changelog.swift in Sources */,
1452C9D225AF86E700C46CDF /* AdvancedTab.swift in Sources */,
Expand Down
10 changes: 5 additions & 5 deletions MeetingBar/ActionsOnEventStart.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AutomaticJoinEvent.swift
// ActionsOnEventStart.swift
// MeetingBar
//
// Created by Jens Goldhammer on 22.03.22.
Expand Down Expand Up @@ -53,8 +53,7 @@ class ActionsOnEventStart: NSObject {

let startEndRange = nextEvent.startDate ... nextEvent.endDate

// time until the start of the event with a delay of 10 seconds
let timeInterval = nextEvent.startDate.timeIntervalSince(now) + 10
let timeInterval = nextEvent.startDate.timeIntervalSince(now)

let allDayCandidate = nextEvent.isAllDay && startEndRange.contains(now)

Expand All @@ -64,7 +63,7 @@ class ActionsOnEventStart: NSObject {
* ------------------------
*/
let actionTimeForEventAutoJoin = Double(Defaults[.automaticEventJoinTime].rawValue)
let nonAlldayCandidateForAutoJoin = (timeInterval > 0 && timeInterval < actionTimeForEventAutoJoin)
let nonAlldayCandidateForAutoJoin = (timeInterval > -15 && timeInterval < actionTimeForEventAutoJoin)

if autoJoinActionActive && (nonAlldayCandidateForAutoJoin || allDayCandidate) {
var events = Defaults[.processedEventsForAutoJoin]
Expand All @@ -76,7 +75,8 @@ class ActionsOnEventStart: NSObject {
// this is an edge case when the event was already notified for, but scheduled for a later time.
if matchedEvent == nil || matchedEvent?.lastModifiedDate != nextEvent.lastModifiedDate {
if nextEvent.meetingLink != nil {
nextEvent.openMeeting()
// nextEvent.openMeeting()
app.openAutJoinWindow(event: nextEvent)
}

// update the executed events
Expand Down
34 changes: 31 additions & 3 deletions MeetingBar/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
.shortenEventTitle, .menuEventTitleLength,
.showEventEndTime, .showMeetingServiceIcon,
.timeFormat, .bookmarks, .eventTitleFormat,
.personalEventsAppereance, .pastEventsAppereance,
.declinedEventsAppereance,
options: []
) {
self.statusBarItem.updateTitle()
Expand All @@ -129,11 +131,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
}
}
eventFiltersObserver = Defaults.observe(
keys: .showEventsForPeriod, .personalEventsAppereance,
.disablePastEvents, .pastEventsAppereance,
keys: .showEventsForPeriod, .customRegexes,
.declinedEventsAppereance, .showPendingEvents,
.showTentativeEvents,
.allDayEvents, .nonAllDayEvents, .customRegexes,
.allDayEvents, .nonAllDayEvents,
options: []
) {
self.statusBarItem.loadEvents()
Expand Down Expand Up @@ -295,6 +296,33 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
changelogWindow.orderFrontRegardless()
}

func openAutJoinWindow(event: MBEvent) {
let screenFrame = NSScreen.main?.frame ?? NSRect(x: 0, y: 0, width: 800, height: 600)

let window = NSWindow(
contentRect: screenFrame,
styleMask: [.borderless],
backing: .buffered,
defer: false
)

window.contentView = NSHostingView(rootView: AutoJoinScreen(event: event, window: window))
window.appearance = NSAppearance(named: .darkAqua)
window.collectionBehavior = .canJoinAllSpaces
window.collectionBehavior = .moveToActiveSpace

window.titlebarAppearsTransparent = true
window.styleMask.insert(.fullSizeContentView)
window.title = "Meetingbar Autojoin"
window.level = .screenSaver

let controller = NSWindowController(window: window)
controller.showWindow(self)

window.center()
window.orderFrontRegardless()
}

@objc
func openPrefecencesWindow(_: NSStatusBarButton?) {
let contentView = PreferencesView()
Expand Down
2 changes: 1 addition & 1 deletion MeetingBar/AppStore.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Store.swift
// AppStore.swift
// MeetingBar
//
// Created by Andrii Leitsius on 06.02.2021.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "pumble_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.
1 change: 0 additions & 1 deletion MeetingBar/Extensions/DefaultsKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ extension Defaults.Keys {
static let declinedEventsAppereance = Key<DeclinedEventsAppereance>("declinedEventsAppereance", default: .strikethrough)
static let pastEventsAppereance = Key<PastEventsAppereance>("pastEventsAppereance", default: .show_inactive)
static let personalEventsAppereance = Key<PastEventsAppereance>("personalEventsAppereance", default: .show_active)
static let disablePastEvents = Key<Bool?>("disablePastEvents")

static let showEventMaxTimeUntilEventThreshold = Key<Int>("showEventMaxTimeUntilEventThreshold", default: 60)
static let showEventMaxTimeUntilEventEnabled = Key<Bool>("showEventMaxTimeUntilEventEnabled", default: false)
Expand Down
4 changes: 2 additions & 2 deletions MeetingBar/Extensions/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ extension String {
/// - Returns: The string without HTML tags.
func htmlTagsStripped() -> String {
if containsHTML,
let data = data(using: .utf16),
let dataUTF16 = data(using: .utf16),
let attributedSelf = NSAttributedString(
html: data,
html: dataUTF16,
options: [.documentType: NSAttributedString.DocumentType.html],
documentAttributes: nil
) {
Expand Down
14 changes: 12 additions & 2 deletions MeetingBar/MeetingServices.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Meeting.swift
// MeetingServices.swift
// MeetingBar
//
// Created by Andrii Leitsius on 09.04.2022.
Expand Down Expand Up @@ -73,6 +73,7 @@ enum MeetingServices: String, Codable, CaseIterable {
case gather = "Gather"
case reclaim = "Reclaim.ai"
case tuple = "Tuple"
case pumble = "Pumble"
case other = "Other"

var localizedValue: String {
Expand Down Expand Up @@ -278,7 +279,7 @@ struct LinksRegex {
let starleaf = try! NSRegularExpression(pattern: #"https?://meet\.starleaf\.com/[^\s]*"#)
let duo = try! NSRegularExpression(pattern: #"https?://duo\.app\.goo\.gl/[^\s]*"#)
let voov = try! NSRegularExpression(pattern: #"https?://voovmeeting\.com/[^\s]*"#)
let facebook_workspace = try! NSRegularExpression(pattern: #"https?://([a-z0-9-.]+)?workplace\.com/[^\s]+"#)
let facebook_workspace = try! NSRegularExpression(pattern: #"https?://([a-z0-9-.]+)?workplace\.com/groupcall/[^\s]+"#)
let skype = try! NSRegularExpression(pattern: #"https?://join\.skype\.com/[^\s]*"#)
let lifesize = try! NSRegularExpression(pattern: #"https?://call\.lifesizecloud\.com/[^\s]*"#)
let youtube = try! NSRegularExpression(pattern: #"https?://((www|m)\.)?(youtube\.com|youtu\.be)/[^\s]*"#)
Expand Down Expand Up @@ -315,6 +316,7 @@ struct LinksRegex {
let reclaim = try! NSRegularExpression(pattern: #"https?://reclaim\.ai/z/[A-Za-z0-9./]+"#)
let tuple = try! NSRegularExpression(pattern: #"https://tuple\.app/c/[^\s]*"#)
let gather = try! NSRegularExpression(pattern: #"https?://app.gather.town/app/[A-Za-z0-9]+/[A-Za-z0-9_-]+\?(spawnToken|meeting)=[^\s]*"#)
let pumble = try! NSRegularExpression(pattern: #"https?://meet\.pumble\.com/[a-z-]+"#)
}

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

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

// tested and verified
case .none:
image = NSImage(named: "no_online_session")!
Expand All @@ -599,6 +605,10 @@ func getIconForMeetingService(_ meetingService: MeetingServices?) -> NSImage {
image = NSImage(named: "vonage_icon")!
image.size = NSSize(width: 16, height: 16)

case .some(.gather):
image = NSImage(named: "gather_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
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"preferences_appearance_events_title" = "Ereignisse";
"preferences_general_feedback_title" = "Bei Fragen oder Feedback\nkannst Du mich gerne kontaktieren:";
"preferences_general_patron_restore_purchases" = "Käufe wiederherstellen";
"preferences_general_patron_thank_for_purchase" = "Danke! Du hast eine Unterstützung von MeetingBar für %d Monate bezahlt. 🎉";
"preferences_general_patron_thank_for_purchase" = "Danke! Du hast MeetingBar für %d Monate unterstützt. 🎉";
"preferences_general_patron_description" = "Es handelt sich um einmalige Käufe, die sich nicht automatisch verlängern.";
"preferences_services_supported_links_mailback" = "Falls der benötigte Service fehlt, bitte eine E-Mail an die Entwickler senden";
"preferences_general_feedback_email" = "E-Mail";
Expand Down Expand Up @@ -124,7 +124,7 @@
"window_title_preferences" = "MeetingBar-Einstellungen";
"next_meeting_empty_message" = "Juhu! Es ist Zeit, Kakao zu machen";
"next_meeting_empty_title" = "Heute finden keine weiteren Meetings statt";
"create_meeting_error_message" = "Benutzerdefinierte URL „%@“ fehlt oder ist ungültig. Bitte in den Einstellungen hinzufügen.";
"create_meeting_error_message" = "Benutzerdefinierte URL „%@“ fehlt oder ist ungültig. ";
"create_meeting_error_title" = "Kann kein neues Meeting erstellen";
"general_meeting" = "Meeting";
"general_save" = "Speichern";
Expand All @@ -142,8 +142,8 @@
"status_bar_show_meeting_names" = "Meeting-Titel anzeigen";
"status_bar_quick_actions" = "Schnellaktionen";
"status_bar_submenu_copy_meeting_link" = "Meeting-Link kopieren";
"status_bar_submenu_dismiss_meeting" = "Dismiss meeting";
"status_bar_submenu_undismiss_meeting" = "Remove dismissal";
"status_bar_submenu_dismiss_meeting" = "Meeting verwerfen";
"status_bar_submenu_undismiss_meeting" = "Dismissal entfernen";
"status_bar_submenu_email_attendees" = "E-Mail an Teilnehmer";
"status_bar_submenu_open_in_fantastical" = "Fantastical öffnen";
"status_bar_submenu_open_in_calendar" = "In Kalender-App öffnen";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
"preferences_appearance_events_value_as_underlined" = "afficher souligné";
"preferences_appearance_events_value_as_inactive" = "afficher comme inactif";
"preferences_appearance_events_value_hide" = "masquer";
"preferences_appearance_events_tentative_title" = "Tentative events:";
"preferences_appearance_events_tentative_title" = "Évènements tentés :";
"preferences_appearance_events_value_show" = "afficher";
"preferences_appearance_events_declined_title" = "Évènements refusés :";
"preferences_appearance_events_pending_title" = "Évènements en attente";
Expand Down
10 changes: 5 additions & 5 deletions MeetingBar/Resources /Localization /it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"general_save" = "Salva";
"general_meeting" = "Riunione";
"create_meeting_error_title" = "Impossibile creare una nuova riunione";
"create_meeting_error_message" = "URL personalizzato \"%@\" mancante o non valido. Aggiungine uno nelle preferenze dell'app.";
"create_meeting_error_message" = "URL personalizzato \"%@\" mancante o non valido. ";
"next_meeting_empty_title" = "Non ci sono riunioni oggi";
"next_meeting_empty_message" = "Woohoo! È ora di fare la cioccolata calda";

Expand Down Expand Up @@ -53,7 +53,7 @@
"preferences_general_patron_six_months" = "6 mesi – 5.99 USD";
"preferences_general_patron_twelve_months" = "12 mesi – 11.99 USD";
"preferences_general_patron_description" = "Si tratta di acquisti una tantum e non si rinnoveranno automaticamente.";
"preferences_general_patron_thank_for_purchase" = "Grazie! Hai pagato per supportare MeetingBar per %d mesi. 🎉";
"preferences_general_patron_thank_for_purchase" = "Grazie! Hai supportato MeetingBar per %d mesi 🎉";
"preferences_general_patron_restore_purchases" = "Ripristina gli acquisti";
"preferences_general_feedback_title" = "Se hai domande o suggerimenti,\nnon esitare a metterti in contatto:";
"preferences_general_feedback_email" = "E-mail";
Expand Down Expand Up @@ -110,7 +110,7 @@
// MARK: - Preferences Services

"preferences_services_link_meeting_title" = "Apri tutti i link delle riunioni in";
"preferences_services_link_service_title" = "Apri i link di %@ in";
"preferences_services_link_service_title" = "Apri i link %@ in";
"preferences_services_link_default_browser_value" = "Browser di default";
"preferences_services_supported_links_list" = "Link supportati per i servizi:\n%@";
"preferences_services_supported_links_mailback" = "Se il servizio che utilizzi non è supportato, puoi inviare un'e-mail agli sviluppatori";
Expand Down Expand Up @@ -239,8 +239,8 @@
"status_bar_error_apple_script_title" = "Errore di AppleScript";
"status_bar_error_link_missed_title" = "Ouch! Non puoi entrare in %@";
"status_bar_error_link_missed_message" = "Link non trovato, o servizio non ancora supportato";
"status_bar_error_app_link_title" = "Oops! Impossibile aprire questo link nell'app %@";
"status_bar_error_app_link_message" = "Assicurati di aver installato l'app %@ o apri il link in un browser dalle preferenze.";
"status_bar_error_app_link_title" = "Ops! Impossibile aprire il link in %@";
"status_bar_error_app_link_message" = "Assicurati di avere installato %@ oppure apri i link in un browser Web dalle preferenze.";

// MARK: - Welcome screen

Expand Down
Loading

0 comments on commit 5769084

Please sign in to comment.