Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Zoom: read names from the video tiles in Gallery view, and know the host is you

Eric Brownroutfe19e48511d2
diff --git a/app/native/yogurt-mac/main.swift b/app/native/yogurt-mac/main.swift
index 916f5e78..d8f2ba9c 100644
--- a/app/native/yogurt-mac/main.swift
+++ b/app/native/yogurt-mac/main.swift
@@ -255,8 +255,9 @@ func axCopy(_ e: AXUIElement, depth: Int, maxDepth: Int, budget: inout Int, zoom
var sz = CGSize.zero
if AXValueGetValue(size as! AXValue, .cgSize, &sz) { n["w"] = Int(sz.width); n["h"] = Int(sz.height) }
}
- // a Zoom tile's description says it all; its children are buttons
- if zoom && role == "AXTabGroup" { return n }
+ // a Zoom tile's description ("Name, Computer audio muted, …") says it all; its children are buttons.
+ // The gallery around the tiles is also a tab group ("Gallery view"), so only a described list stops the walk.
+ if zoom && role == "AXTabGroup", let d = n["d"] as? String, d.contains(",") { return n }
guard depth < maxDepth, let kids = at(7) as? [AXUIElement], !kids.isEmpty else { return n }
var out: [[String: Any]] = []
for k in kids {
diff --git a/app/src/main/callNames/parse.ts b/app/src/main/callNames/parse.ts
index 3fa9039e..90f85e1a 100644
--- a/app/src/main/callNames/parse.ts
+++ b/app/src/main/callNames/parse.ts
@@ -50,11 +50,19 @@ const AUDIO = new Set(ZOOM.flatMap((l) => [low(l[0]), low(l[1])]))
const ACTIVE = new Set(ZOOM.map((l) => low(l[2])))
const TALKING = ZOOM.map((l) => l[3].normalize('NFKC').replace(/\s*[::]$/, ''))
const LISTS = new Set(ZOOM.map((l) => low(l[4])))
-const SELF = ZOOM.map((l) => l[5].normalize('NFKC'))
+const SELF = new Set(ZOOM.map((l) => low(l[5]).replace(/[()]/g, '')))
/** other things Zoom appends to a tile, which say nothing about who it is */
const OTHER_STATUS = /^(video (on|off)|no audio|telephone.*|screen sharing.*|pinned|spotlighted)$/i
-/** Zoom's own tags after a name: never part of it */
-const ZOOM_TAGS = /\s*[((](me|host|co-host|guest|interpreter|participant id: [^)]*|ich|yo|moi|io|eu|ik|jag|自分|我)[))]\s*$/i
+/** Zoom's own tags after a name, alone or together ("(Host, me)"): never part of it */
+const TAG = 'me|host|co-host|guest|interpreter|participant id: [^),]*|ich|yo|moi|io|eu|ik|jag|自分|我'
+const ZOOM_TAGS = new RegExp(`\\s*[((]\\s*(?:${TAG})(?:\\s*[,,、]\\s*(?:${TAG}))*\\s*[))]\\s*$`, 'i')
+/** "Ana Ruiz (Host, me)" → host, me */
+const tagsOf = (raw: string): string[] => {
+ const out: string[] = []
+ let name = raw.normalize('NFKC').trim(), m: RegExpMatchArray | null
+ while ((m = name.match(ZOOM_TAGS))) { out.push(...m[0].replace(/^\s*\(|\)\s*$/g, '').split(/[,、]/).map(low)); name = name.slice(0, m.index) }
+ return out
+}
const cleanZoom = (raw: string): string | null => {
let name = raw.normalize('NFKC').trim()
@@ -103,7 +111,7 @@ function readZoom(windows: AxWindow[]): CallReading {
const name = cleanZoom(text)
if (!name) return
participants.push(name)
- if (SELF.some((s) => text!.normalize('NFKC').includes(s))) me = name
+ if (tagsOf(text).some((tag) => SELF.has(tag))) me = name
}
})
}
diff --git a/app/test/callParse.test.ts b/app/test/callParse.test.ts
index 58984114..ff8e8b04 100644
--- a/app/test/callParse.test.ts
+++ b/app/test/callParse.test.ts
@@ -33,6 +33,11 @@ describe('Zoom', () => {
expect(r).toEqual({ speaking: ['Dana Smith'], participants: ['Alex Morgan', 'Dana Smith', 'Ann Lee'], me: 'Alex Morgan' })
})
+ it('the host using Yogurt: "(Host, me)" is one tag group, so the name is clean and known to be "me"', () => {
+ const r = readCall('zoom', [zoomWindow(['Alex Morgan, Computer audio unmuted'], ['Alex Morgan (Host, me)', 'Ann Lee (Co-host)'])])
+ expect(r).toEqual({ speaking: [], participants: ['Alex Morgan', 'Ann Lee'], me: 'Alex Morgan' })
+ })
+
it('with the list closed nobody is known to be "me"; with nobody marked nobody talks', () => {
const r = readCall('zoom', [zoomWindow(['Alex Morgan, Computer audio unmuted', 'Dana Smith, Computer audio unmuted'])])
expect(r).toEqual({ speaking: [], participants: ['Alex Morgan', 'Dana Smith'], me: null })