Toggle Whisper šŸ‘

Sorted. This is now with the original author who can take this forward.

2 Likes

Thanks for sorting that out. :pray: :slight_smile:

3 Likes

@ganncamp
I’ve fixed the immediate issue. There’s one caveat though. Currently the Discourse backend only supports staff users to be able to switch a post’s post_type so I have made the :eye: toggle icon to to appear if a user is in whispers_allowed_groups and also a staff member. Do let us know your thoughts on this.

3 Likes

I appreciate the effort. I came up with came up with a solution which reduces the complexity a bit. Also thanks for pointing out the actual cause.

2 Likes

That’s fine for us; only staff can see whispers.

And… I’m not seeing this on my instance yet…?

1 Like

And now it works! Thanks!

2 Likes

image
Breaking change on new version of discourse

5 Likes

I recently ran into the same problem as well, so I rewrote the component and made a PR. Pull requests Ā· fzngagan/discourse-toggle-whisper

@fzngagan Can you take a look at it?

11 Likes

Just tested it and it works like a charm. The code looks nice too. Thanks so much for this, it save me a bunch of work. Merged :tada:

5 Likes


It does have some issues though, when not logged in.

it causes much more than just 1 error also.

3 Likes

I made a quick PR to fix the issue :+1: (@fzngagan)

5 Likes

Nice one! i love coding… a simple ? and the problem is solved :joy:

3 Likes

The toggle whisper icon is not appearing on our site anymore, we are running on 3.4.1. Anyone else having same issue?

@fzngagan heads up on a 404 link here:

There’s a potential leak here whereby some users can still visibly see the whispered posts.

Steps to replicate:

  1. Without whispering, reply direct to or quote a user in a post/reply
  2. Change the post to a whisper
  3. The @mentioned / @quoted user can still visibly see the whispered post

I don’t think I can repro that?

My step by step just to see if I’m doing a :derp:

  • Test_One creates post by directly replying to Test_Two
  • Also throws in a quote of Test_Three and an @mention of Test_Four
  • As admin, toggle that post into a whisper

The only people who can see the whisper are Admin and Test_One (which is expected, as you can see your own whisper posts even after you can no longer create whispers) [this has since been fixed see below]

Is it a page refresh thing?

1 Like

I’ll check with my colleague who reported the issue to confirm, but:

Is Test_One an admin? :thinking:

No, just a normal non-staff user.

Does it need to be an admin and/or mod?

ETA: re-running the test using an admin to create the direct reply (with quote + mention) seems to be offering similar results.

There is a ux oddity in that each of these test users got a notification for the respective things, and when followed the post was no longer there for them to see.

There’s also another ux one for the expandable ā€˜x replies’ box where the count includes the whisper, but doesn’t show it when expanded.

1 Like

Unsure, we’ll do some more testing and report back, thanks :smiley:

1 Like

This is now no longer the case :tada:

5 Likes