Skip to content

Commit

Permalink
Merge pull request #1247 from jijojosephk/fix_awayOnSystemIdle_v2
Browse files Browse the repository at this point in the history
Fix awayOnSystemIdle flag in Teams V2
  • Loading branch information
jijojosephk authored May 4, 2024
2 parents f0c2825 + 0df56d1 commit d3d8573
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
26 changes: 20 additions & 6 deletions app/browser/tools/activityHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ActivityHub {
// ALTERNATIVE: teams2IdleTracker._idleStateBehaviorSubject.next('Inactive');
teams2IdleTracker.transitionToIdle();
}
} catch(e) {
} catch (e) {
console.error('Failed to set teams2 Machine State', e);
}
} else {
Expand All @@ -89,11 +89,25 @@ class ActivityHub {
* @param {number} status
*/
setUserStatus(status) {
instance.whenReady().then((inst) => {
inst.injector.get('presenceService').setMyStatus(status, null, true);
}).catch(() => {
console.error('Failed to set User Status');
});
const teams2IdleTracker = ReactHandler.getTeams2IdleTracker();
if (teams2IdleTracker) {
try {
console.log(`setUserStatus teams2 status=${status}`);
if (status === 1) {
teams2IdleTracker.handleMonitoredWindowEvent();
} else {
teams2IdleTracker.transitionToIdle();
}
} catch (e) {
console.error('Failed to set teams2 User Status', e);
}
} else {
instance.whenReady().then((inst) => {
inst.injector.get('presenceService').setMyStatus(status, null, true);
}).catch(() => {
console.error('Failed to set User Status');
});
}
}

refreshAppState(controller, state) {
Expand Down
7 changes: 7 additions & 0 deletions com.github.IsmaelMartinez.teams_for_linux.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
<url type="bugtracker">https://github.com/IsmaelMartinez/teams-for-linux/issues</url>
<launchable type="desktop-id">com.github.IsmaelMartinez.teams_for_linux.desktop</launchable>
<releases>
<release version="1.4.37" date="2024-05-04">
<description>
<ul>
<li>Fix awayOnSystemIdle flag in Teams V2</li>
</ul>
</description>
</release>
<release version="1.4.36" date="2024-05-03">
<description>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "1.4.36",
"version": "1.4.37",
"main": "app/index.js",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
Expand Down

0 comments on commit d3d8573

Please sign in to comment.