Communications, calls, and meetings
The desktop communication layer keeps the Teams workspace active while it is in the background and adds native ways to notice and enter conversations. It connects Teams activity to network recovery, system notifications, incoming-call controls, meeting links, quick chat, media sharing, and optional external status tools.
Communication surface
The communication surface joins events from the Teams page to desktop windows and system services. Teams remains the source of conversation and call state. The desktop layer adds the paths that make that state visible or actionable outside the main page.
The main paths are:
- Connectivity: keeps the Teams page usable after network changes or system resume. See Connectivity and real-time events.
- Alerts: turns Teams messages, meeting starts, and incoming calls into native or in-app notices. See Notifications and call alerts.
- Meeting and chat entry: accepts meeting links and opens one-to-one chats from desktop entry points. See Meeting and chat entrypoints.
- Media sharing: lets the user choose a screen or window and keeps a small preview while sharing. See Screen sharing and media.
- External control: can publish status and call state through MQTT and can accept a small allow-list of call commands when configured.
The event path below shows how a Teams event can move from the page to a desktop surface or an external system.
flowchart LR
Teams[Teams workspace] --> Events[Activity and media events]
Events --> Desktop[Desktop surfaces]
Desktop --> Alerts[Notifications and call controls]
Desktop --> Entry[Meeting and chat entry]
Events --> Share[Screen and media state]
Events --> MQTT[Optional MQTT and Home Assistant state]
Network[Network or resume change] --> Recovery[Teams page recovery]
Recovery --> Teams
References: app/…/preload.js• L411-477 app/…/activityManager.js• L4-16 app/index.js• L130-155 app/index.js• L445-524
Calls and meeting activity
The activity path turns Teams call signals into stable desktop events. The browser side watches Teams activity and forwards incoming-call, connected-call, disconnected-call, and meeting-start signals to the main process. The main process can then update alerts, media state, and external integrations without making those consumers inspect the Teams page themselves.
The supported event set is deliberately small:
| Event | Desktop meaning |
|---|---|
incoming-call-created | An incoming call can be shown to the user. |
incoming-call-ended | The incoming-call surface can close or clear. |
call-connected | A call or meeting is active. |
call-disconnected | The active call has ended. |
meeting-started | A scheduled meeting start was detected. |
Meeting-start detection is best effort. The preferred path uses structured Teams activity. A DOM-based fallback watches marked alert surfaces and sends only the fact of a match. This avoids treating ordinary chat text as a meeting event, but it can still need updates when Teams changes its page or wording.
References: app/…/activityHub.js• L4-10 app/…/activityHub.js• L200-241 app/…/activityHub.js• L243-323 app/…/meetingStartDetector.js• L87-138 app/…/meetingStartDetector.js• L174-263
Native alerts
Native alerts bring Teams activity to the operating system when the main workspace is hidden or in the background. The desktop service can play a message or meeting sound, display a system notification, and relay a later click or close event back to the Teams page so Teams can update the related conversation.
The alert path preserves the link between a notification and its source conversation. A click can show or restore the main window before the event returns to Teams. A close event is delivered only once, even when both Teams and the operating system report the close.
Users can also receive an in-app toast or a dedicated incoming-call window. The incoming-call surface offers audio accept, video accept, and decline actions. Those actions return to the Teams page, where the matching call control is used.
References: app/…/service.js• L13-43 app/…/service.js• L45-151 app/…/notificationBridge.js• L22-75 app/…/index.js• L4-69 app/…/index.js• L5-48 app/…/activityManager.js• L55-115
Meeting and chat entry
The desktop provides more than one way to enter a conversation. A valid Teams meeting link can open in the current workspace through the Teams single-page route or through full navigation when the page does not consume the route. A meeting dialog can validate a link copied from the clipboard before it sends the link to the workspace.
Quick Chat provides a separate, short path to a one-to-one message. It searches contacts through Microsoft Graph, resolves the matching Teams conversation, and sends the message through the configured Graph API access. It is optional and does not replace the full Teams chat view.
The related page describes link validation, deep-link routing, and quick chat in detail: Meeting and chat entrypoints.
References: app/…/deepLinkRouter.js• L13-55 app/…/deepLinkRouter.js• L76-148 app/…/index.js• L23-105 app/…/index.js• L10-58 app/…/quickChatModalPreload.js• L3-22 app/…/ipcHandlers.js• L68-94
Media sharing
Screen sharing gives the user a controlled choice of a display or application window before Teams receives a capture stream. The picker shows available sources and display information. After selection, the desktop tracks the active share and can show an always-on-top preview.
The preview uses the active share stream rather than starting a second capture. Sharing ends when the media tracks end, the Teams stop control disappears, or the user stops sharing from the preview. The resulting state can also feed the optional MQTT media topics.
The related page covers source selection, preview behavior, and platform differences: Screen sharing and media.
References: app/…/service.js• L4-33 app/…/service.js• L60-107 app/…/service.js• L131-200 app/…/index.js• L4-120 app/…/injectedScreenSharing.js• L81-145 app/…/injectedScreenSharing.js• L148-203
External status and control
Optional MQTT integration extends communication state beyond the desktop. The application can publish presence, call, incoming-call, meeting-start, camera, microphone, and screen-sharing state to a broker. It can also receive a restricted set of commands for mute, video, hand raise, and calendar reads.
The integration treats connection state as part of the contract. It marks the broker connection as available or unavailable, republishes retained status when state changes, and republishes Home Assistant discovery data after a broker reconnect. It does not run when MQTT is disabled or no broker is configured.
The main communication-related external states are:
- Presence: available, busy, do not disturb, away, or be right back.
- Call state: in call or incoming call.
- Meeting state: a short meeting-start signal.
- Media state: camera, microphone, and screen sharing.
- Controls: mute, video, and hand raise when a command topic is enabled.
References: app/…/index.js• L8-38 app/…/index.js• L40-112 app/…/index.js• L203-241 app/…/mediaStatusService.js• L19-57 app/…/mediaStatusService.js• L70-169 app/…/homeAssistantDiscovery.js• L4-16 app/…/homeAssistantDiscovery.js• L119-171
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the event names shared by
activityHub,ActivityManager, notification services, and the MQTT media service aligned. A rename can silently remove alerts or external state updates. - Keep notification identifiers scoped to the renderer that created them. Multi-account workspaces must not receive another profile's click or close event.
- Keep meeting-link routing and profile window-open policy consistent. A deep link must enter the originating Teams workspace rather than a different profile or a short-lived popup.
- Keep screen-share source selection and capture handling on the same session. A second source enumeration can invalidate the selected source on portal-based desktops.
- Keep MQTT media topic defaults and Home Assistant discovery topic names aligned when a media topic is renamed.
- Keep the notification method contract aligned between preload and the main notification service. Each method must still provide Teams with a usable notification object or stub.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Network loss or resume leaves the Teams page in a failed state | The workspace can remain blank or stale instead of recovering | Connectivity checks and debounced reloads are described in Connectivity and real-time events. |
| Teams changes the internal event shape or alert markup | Calls or meeting starts may not produce desktop events | Structured activity detection has a marked-surface DOM fallback. Both paths are best effort. |
| A notification click arrives after the workspace is hidden or closed | The conversation may not open, or a destroyed window may throw | The service checks the window before showing it and the bridge ignores stale IDs. |
| Screen-share picker returns no source or the media track ends | Sharing does not start or the preview closes while Teams remains active | Picker cancellation returns an empty selection and stream end paths clear the active state. |
| MQTT broker is unavailable | External status and control state becomes stale | Broker availability is published and normal publish operations skip while disconnected. |
| Graph API access is disabled or token acquisition fails | Quick Chat cannot search or send a message | Graph IPC handlers return an explicit disabled or failed result instead of sending partial data. |
Key files
| File | Why to read it |
|---|---|
| app/index.js | Main-process assembly point for notification, screen-share, MQTT, Graph API, and quick-chat services. |
| app/…/preload.js | Renderer boundary that exposes desktop actions and starts communication-related browser tools. |
| app/…/activityHub.js | Defines the small event model for calls and meeting starts. |
| app/…/activityManager.js | Connects Teams activity events to native call and notification actions. |
| app/…/service.js | Shows native alerts and sends click and close results back to the correct Teams renderer. |
| app/…/deepLinkRouter.js | Explains how meeting and chat links enter the loaded Teams single-page app. |
| app/…/QuickChatModal.js | Shows the separate quick-chat desktop surface. |
| app/…/service.js | Owns capture source selection and active sharing state. |
| app/…/injectedScreenSharing.js | Connects Teams media requests to share start, stop, and preview state. |
| app/…/mediaStatusService.js | Maps calls and media events to external state topics. |
| app/…/index.js | Owns network checks and Teams page recovery after connectivity changes. |