I think ement-after-initial-sync-hook is called per session, and creates a duplicate idle timer each time?
(defun ement--run-idle-timer (&rest _ignore)
"Run idle timer that updates read receipts.
To be called from `ement-after-initial-sync-hook'. Timer is
stored in `ement-read-receipt-idle-timer'."
(setf ement-read-receipt-idle-timer (run-with-idle-timer 3 t #'ement-room-read-receipt-idle-timer)))
It seems like it should simply test the variable to see whether it's already a timer?
And if ement can disconnect from individual sessions then I expect ement--stop-idle-timer called from ement-disconnect-hook also needs to check for remaining sessions.
I think
ement-after-initial-sync-hook
is called per session, and creates a duplicate idle timer each time?It seems like it should simply test the variable to see whether it's already a timer?