This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,34 @@
// Metro module 12731 (f12732).
import SelfPresenceStore from "../../stores/SelfPresenceStore";
import StateManager from "../../lib/StateManager";
import rateLimit from "../../lib/rateLimit";
class LocalPresenceStateManager extends StateManager {
switchingAccounts = false;
didCommit = rateLimit(5, 20000, this.emitPresenceUpdate.bind(this));
constructor(a0) {
super(false);
this.socket = a0;
}
getInitialState() {
return SelfPresenceStore.getLocalPresence();
}
getNextState() {
return SelfPresenceStore.getLocalPresence();
}
shouldCommit() {
return this.socket.isSessionEstablished();
}
emitPresenceUpdate(a0) {
this.socket.presenceUpdate(a0.status, a0.since, a0.activities, a0.afk);
}
handleConnectionOpen() {
this.update({}, !this.switchingAccounts);
this.switchingAccounts = false;
}
handleAccountSwitch() {
this.switchingAccounts = true;
this.reset();
this.emitPresenceUpdate(this.getState());
}
}
export default LocalPresenceStateManager;