discourse/plugins
zogstrip c15ef42db7
FIX: respect "hide presence" when displaying "is typing/replying..."
While trying to reproduce an issue reported internally where a user saw the "is replying..." from another user who had disabled presence (aka. was "offline"), I noticed something odd about the way we "notify" presence via `notifyState`. The way it is setup up, it's being called on every "input" event in the composer/editor, due to it tracking the "reply" property of the composer model. That's fine, but the way the `helperFn` helper works, make it so we're calling the `on.cleanup` callback also on **every** "input" events in the composer/editor. For every character we enter in the composer, we're "entering" the presence channel and immediatelly "leaving" it...

If I remove the checks on `reply` (and thus the auto-tracking), then the `notifyState` function is called much less frequently. But we have some specs that expects us not to "publish" our presence when we open the composer and the reply is "empty".

Note: I switched to using `replyDirty` instead to re-use the checks the composer model is already doing to ensure we actually have changed something in the reply.

The best I came up with was not to rely on the `helperFn` but now, there's no way (that I could find) to call `composerPresenceManager.leave()` when the composer is closed. I tried a lot of different ways, but none worked. I'm sure it's something stupid easy, but I can't figure it out just now.

Internal ref - t/127490/74
2024-12-04 12:30:27 +01:00
..
automation DEV: Correctly lint bundled plugins admin directory (#29999) 2024-12-02 16:31:21 +00:00
chat DEV: Deleted the "ChatComposerPresenceManager"... (#30098) 2024-12-04 12:21:55 +01:00
checklist DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
discourse-details DEV: Use qunit-dom's hasValue wherever possible (#30018) 2024-12-01 20:37:24 +01:00
discourse-lazy-videos Update translations (#28577) 2024-08-29 15:37:52 -04:00
discourse-local-dates DEV: refactor composer-editor/d-editor, a little more (#29973) 2024-12-02 18:24:14 -03:00
discourse-narrative-bot Update translations (#30062) 2024-12-04 11:59:28 +01:00
discourse-presence FIX: respect "hide presence" when displaying "is typing/replying..." 2024-12-04 12:30:27 +01:00
footnote Update translations (#30062) 2024-12-04 11:59:28 +01:00
poll Update translations (#30062) 2024-12-04 11:59:28 +01:00
spoiler-alert DEV: Use qunit-dom's hasValue wherever possible (#30018) 2024-12-01 20:37:24 +01:00
styleguide FIX: Tooltip styleguide triggers not rendering options (#29926) 2024-11-25 16:00:52 -06:00