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.

Call names (Teams in English on Windows): a tile with no label inside is read by its name before "video is on", the mute word comes from the video image that names the person so the one other person unmuted is named, and the log says again what Teams shows once the call's app is known (#83)

christianmat46a5096f2801
diff --git a/app/src/main/callNames/index.ts b/app/src/main/callNames/index.ts
index 9dcf3462..82042091 100644
--- a/app/src/main/callNames/index.ts
+++ b/app/src/main/callNames/index.ts
@@ -185,7 +185,8 @@ export function hookCallNames(p: {
s.windowSeen = undefined; s.goneSince = undefined; s.goneAt = undefined
log(`call names: the call is in ${m.app}, reading only it`)
if (!ids.length) return
- s.pictured = false
+ // the log says again what the call's own app shows, even when it reads as what the last app did (#83)
+ s.pictured = false; s.last = ''
begin(m.id, s)
})
diff --git a/app/src/main/callNames/parse.ts b/app/src/main/callNames/parse.ts
index 00596a83..3133d3e2 100644
--- a/app/src/main/callNames/parse.ts
+++ b/app/src/main/callNames/parse.ts
@@ -293,6 +293,9 @@ const titleName = (title: string | undefined): string | null => {
/** the mute word a meeting tile carries (#83: "Name, <meeting title>, stummgeschaltet, Kontextmenü ist verfügbar") */
const TEAMS_MUTED = /^(?:muted|stummgeschaltet|mic(?:rophone)? (?:is )?off|mikrofon (?:ist )?aus)$/i
+const TEAMS_UNMUTED = /^(?:unmuted|stummschaltung aufgehoben|nicht stummgeschaltet|mic(?:rophone)? (?:is )?on|mikrofon (?:ist )?(?:an|ein))$/i
+/** the last words of every tile: a tile with no label inside (English Teams on Windows, 0.3.69) is "Name, ..., <this>" */
+const TEAMS_HINT = /^(?:context menu is available|kontextmenü ist verfügbar)$/i
/** my own tile's label adds a short word after the name: "Christa, Ich" */
const OWN_LABEL = /^(.+?),\s*(\p{L}{1,5})$/u
@@ -321,7 +324,21 @@ function teamsTile(n: AxNode, alone: boolean): { name: string; speaking: boolean
const fields = rest.split(/\s*,\s*/).filter(Boolean)
return { name, speaking: fields.some((f) => TEAMS_SAYS.test(f)), me: head !== raw || TEAMS_ME.test(head), muted: fields.length ? fields.some((f) => TEAMS_MUTED.test(f)) : null }
}
- return null
+ // no label inside: the name is the first of the tile's words when they end with Teams' context-menu hint
+ const fields = label.split(/\s*,\s*/)
+ if (heads.length || fields.length < 3 || !TEAMS_HINT.test(fields.at(-1)!)) return null
+ const name = cleanTeams(fields[0])
+ if (name.length < 2 || name.length > 60 || !/\p{L}/u.test(name) || /[+\d]/.test(name)) return null
+ const rest = fields.slice(1)
+ return { name, speaking: rest.some((f) => TEAMS_SAYS.test(f)), me: TEAMS_ME.test(fields[0]), muted: rest.some((f) => TEAMS_MUTED.test(f)) }
+}
+
+/** what a tile's video image says about mute, by the names among its words: "..., Unmuted, video is on, ..., Dana Smith" */
+function imageMutes(n: AxNode, into: Map<string, boolean>) {
+ const fields = (n.t ?? n.d ?? '').normalize('NFKC').split(/\s*,\s*/).filter(Boolean)
+ const muted = fields.some((f) => TEAMS_MUTED.test(f)), unmuted = fields.some((f) => TEAMS_UNMUTED.test(f))
+ if (muted === unmuted) return
+ for (const f of fields) into.set(low(f), muted)
}
function readTeams(windows: AxWindow[]): CallReading {
@@ -330,11 +347,13 @@ function readTeams(windows: AxWindow[]): CallReading {
for (const w of windows) {
let call = false, oneToOne = false, unread = false
const states: Array<{ name: string; muted: boolean | null; me: boolean }> = []
+ const mutes = new Map<string, boolean>()
walk(w.tree, (n) => { if (n.i === 'hangup-button') call = true; if (n.i && TEAMS_ONE_TO_ONE.has(n.i)) oneToOne = true })
const tiles: string[] = []
walk(w.tree, (n, up) => {
if (n.i === TEAMS_POPUPS || up.some((a) => a.i === TEAMS_POPUPS)) return
const inStage = call && !up.some((a) => TEAMS_BARS.has(a.r))
+ if (inStage && (n.r === 'image' || n.r === 'AXImage')) imageMutes(n, mutes)
const tile = TEAMS_TILE.has(n.r) ? teamsTile(n, inStage) : null
if (tile) { participants.push(tile.name); tiles.push(tile.name); states.push(tile); if (tile.speaking) speaking.push(tile.name); if (tile.me) me = tile.name }
// a tile-shaped menu item ("..., ..., ...") whose person couldn't be read: who is muted can't be told
@@ -360,6 +379,8 @@ function readTeams(windows: AxWindow[]): CallReading {
// person not muted, and at least one other muted, the sound is theirs. My own tile never counts; two or more not
// muted, a tile that couldn't be read, or a tile that says nothing either way name nobody.
if (call && !oneToOne && !speaking.length && !unread) {
+ // the video image's word wins over a tile that says nothing
+ for (const t of states) { const m = mutes.get(low(t.name)); if (m !== undefined) t.muted = m }
const others = states.filter((t) => !t.me && (!me || low(t.name) !== low(me)))
const open = others.filter((t) => t.muted === false)
if (others.length >= 2 && others.every((t) => t.muted !== null) && open.length === 1) { speaking.push(open[0].name); byMute = true }
diff --git a/app/test/callNames.test.ts b/app/test/callNames.test.ts
index 4e3370cc..3f99fe77 100644
--- a/app/test/callNames.test.ts
+++ b/app/test/callNames.test.ts
@@ -306,6 +306,16 @@ describe('hookCallNames', () => {
expect(two.hook.nameFor(two.m.id, 6000, 8000)).toBe('Dana Smith')
})
+ it('after the call app is known, the first reading says what it found again, even when it is what the last one said (#83: 38 minutes with no line)', () => {
+ const s = setup({ app: null })
+ s.start()
+ const empty: WatchLine = { t: 1_000_000, app: 'ms-teams.exe', windows: [{ title: 'Sync | Microsoft Teams', tree: { r: 'frame', k: [{ r: 'push button', i: 'hangup-button', t: 'Leave' }] } }] }
+ s.emit(empty)
+ s.bind('Teams')
+ s.emit({ ...empty, t: 1_001_000 })
+ expect(s.logs.filter((l) => l === 'call names: teams talking 0 of 0')).toHaveLength(2)
+ })
+
it('reads Webex roster names during a call', () => {
const s = setup({ app: 'Webex' })
s.start()
diff --git a/app/test/callParse.test.ts b/app/test/callParse.test.ts
index 5564e781..605af69f 100644
--- a/app/test/callParse.test.ts
+++ b/app/test/callParse.test.ts
@@ -342,6 +342,40 @@ describe('a Teams meeting where nobody is marked as talking (#83)', () => {
})
})
+// ---- new Teams in English on Windows (#83, 0.3.69): tiles with no label inside, the mute word on the video image ----
+// menu item "Name, video is on, <meeting title>, Context menu is available"; beside it an image whose words carry
+// "Unmuted" or "Muted" and end with the person's name. Names made up.
+const EN_TITLE = 'Quarterly planning with Contoso'
+const enTile = (name: string, video = 'video is on', extra = '') => node('menu item', { t: `${name}, ${video}, ${EN_TITLE}, ${extra}Context menu is available` })
+const enVideo = (name: string, mic: 'Unmuted' | 'Muted') => node('image', { i: `menu${name.length}x`, c: ['fui-Primitive', 'vdi-dynamic-occlusion'], t: `Video, of, call, ${EN_TITLE}, ${mic}, video is on, Pinned off, ${name}` })
+const enMeeting = (stage: AxNode[]) => win(node('frame', { t: `${EN_TITLE} | Microsoft Teams` },
+ node('panel', { i: 'app' },
+ node('push button', { i: 'organizer-control-button', t: 'Meeting options' }),
+ node('push button', { i: 'start-breakout-room-button', t: 'Rooms' }),
+ node('panel', { i: 'horizontalEnd' }, node('push button', { i: 'hangup-button', t: 'Leave' })),
+ ...stage)), `${EN_TITLE} | Microsoft Teams`)
+
+describe('new Teams in English on Windows (#83)', () => {
+ it('reads a tile with no label inside: the name before "video is on" (or off), never the meeting title or the hint', () => {
+ const r = readCall('teams', [enMeeting([enTile('Dana Smith'), enTile('Ann Lee', 'Video is off'), enTile('Bo Park', 'video is off')])])
+ expect(r.participants).toEqual(['Dana Smith', 'Ann Lee', 'Bo Park'])
+ })
+ it('takes the mute word from the video image that names the person, so the one other person unmuted is the one talking', () => {
+ const stage = [enVideo('Dana Smith', 'Unmuted'), enTile('Dana Smith'), enVideo('Ann Lee', 'Muted'), enTile('Ann Lee'), enTile('Bo Park', 'video is off', 'Muted, ')]
+ expect(readCall('teams', [enMeeting(stage)])).toEqual({ speaking: ['Dana Smith'], participants: ['Dana Smith', 'Ann Lee', 'Bo Park'], me: null, byMute: true })
+ // an image naming nobody shown says nothing about anyone
+ const stray = [enVideo('Cy Young', 'Unmuted'), enTile('Ann Lee', 'video is on', 'Muted, '), enTile('Bo Park', 'video is on', 'Muted, ')]
+ expect(readCall('teams', [enMeeting(stray)]).speaking).toEqual([])
+ })
+ it("my own tile (\"Name (You)\") is me, so with one other person the reading is a call of two", () => {
+ const r = readCall('teams', [enMeeting([enTile('Alex Morgan (You)'), enVideo('Dana Smith', 'Unmuted'), enTile('Dana Smith')])])
+ expect(r).toEqual({ speaking: [], participants: ['Alex Morgan', 'Dana Smith'], me: 'Alex Morgan' })
+ })
+ it('one other tile alone in a meeting names nobody: a bigger meeting with the chat open shows one tile too (#83, 15:30)', () => {
+ expect(readCall('teams', [enMeeting([enVideo('Dana Smith', 'Unmuted'), enTile('Dana Smith')])]).speaking).toEqual([])
+ })
+})
+
describe('summarize: a short picture of the tree for the log', () => {
it("counts roles and shows ids, classes and the app's own words, never a name or anything said", () => {
const captions = node('AXGroup', { i: 'captions' }, node('AXStaticText', { v: 'we can sign the renewal with Acme on Friday' }))