fzngagan
(Faizaan Gagan)
2 مارس 2021، 2:36م
1
This theme component adds a post menu button for staff users to make a regular post a whisper or vice versa.
How to install
Get the code
This is useful especially for forums where a lot of conversations happen in whisper and a staff user ends up posting something and later wants to hide or show the post to non-staff users.
30 إعجابًا
Nice! I remember this debate a few years ago. I have been burned by this so many times. The official response is:
Er, the cat is out of the bag once you post as a not-whisper. Going back and retconning posts into whispers via editing is not something I can support as a feature.
I am often scrambling to delete whispers before they get emailed out and too many people notice my mistake!
9 إعجابات
Brilliant component!
is this possible to just make it so it appears on staff posts?
4 إعجابات
fzngagan
(Faizaan Gagan)
3 مارس 2021، 7:04ص
5
I’ll take a look at this request soon.
p.s.
This is addressed now.
إعجابَين (2)
j.jaffeux
(Joffrey Jaffeux)
3 مارس 2021، 7:44ص
6
Yes I think the same, it’s very easy to get wrong with whispers and this is one of the cases where simplicity has too be sacrified for peace of mind.
5 إعجابات
fzngagan
(Faizaan Gagan)
3 مارس 2021، 7:57ص
7
My question then is, does discourse behave differently in terms of email if the post is deleted vs when its post_type is changed?
إعجاب واحد (1)
ganncamp
(G Ann Campbell)
10 مايو 2023، 1:09م
8
We have this component installed, but the toggle no longer shows up.
Has it stopped working, or is it possible that we made some edit elsewhere (to our themes?) that inadvertently blocked it?
chapoi
(Charlie)
10 مايو 2023، 1:12م
9
It’s definitely still working on meta.
What does your setting here say:
إعجاب واحد (1)
chapoi
(Charlie)
10 مايو 2023، 1:17م
17
Ah I misread the original issue, it’s not about the general whisper functionality, gotcha! @fzngagan is already on the case it seems
إعجاب واحد (1)
Lhc_fl
(Linca)
10 مايو 2023، 1:37م
18
export default {
name: "toggle-whispers",
initialize() {
withPluginApi("0.11.0", whisperInit);
},
};
const whisperInit = (api) => {
const currentUser = api.getCurrentUser();
const siteSettings = api._lookupContainer("site-settings:main");
if (currentUser && currentUser.staff && siteSettings.enable_whispers) {
api.attachWidgetAction("post-menu", "toggleWhisper", function () {
const model = this.attrs;
let newType = model.post_type === 1 ? 4 : 1;
ajax(`/posts/${model.id}/post_type`, {
type: "PUT",
data: {
post_type: newType,
},
}).catch(popupAjaxError);
Apparently this code is broken. siteSettings.enable_whispers
has been modified to siteSettings.whisper_allowed_groups
.
You can try my fork here:
3 إعجابات
ganncamp
(G Ann Campbell)
10 مايو 2023، 2:20م
19
Thanks @Lhc_fl ! Unfortunately, I don’t think I can try your fork since we’re on a hosted instance. But I appreciate your quick investigation! Maybe that will speed up the official fix.
إعجاب واحد (1)
You can have any theme component you like. It’s only plugins that need to be official (or vetted)
However, I think @fzngagan will want to fix this one up, so if you can wait it may be better in this case.
إعجابَين (2)
It’s actually a pavilion repo
@Lhc_fl PR and I will review.
إعجابَين (2)
Do you want to add the pavilion tag?
إعجاب واحد (1)
Yeah let’s do that and I’ll discuss if @fzngagan wants to pass the Topic over.
إعجاب واحد (1)
@merefield Is there any movement on this? I think it may still be in limbo?
3 إعجابات
It’s waiting on a (presumably trivial) org decision. I chased today.
إعجابَين (2)