FriendsOfFlarum / prevent-necrobumping

Warn before necrobumping old discussions
MIT License
6 stars 3 forks source link

Extension prevents posting updates on a thread that is under the age limit #3

Closed ExZiByte closed 5 years ago

ExZiByte commented 5 years ago

When I activate the extension and input the settings how I would like it to work. I have it set to warn after 30 days, but when I try to post on a thread that is 3 days old, the extension just says "This discussion is too old to reply to.". The thread I am posting on did exist prior to activating the extension so that could be the cause.

dsevillamartin commented 5 years ago

Hm... it shouldn't matter if the discussion existed before enabling the discussion or not. Perhaps the server logic that validates the age is incorrect. Does the yellow warning message appear when replying to the discussion?

ExZiByte commented 5 years ago

No it only shows this in the bottom right of the screen image

dsevillamartin commented 5 years ago

Then it is a bug with the server verification. Not sure what could cause 27 days to be ignored 🤔

luceos commented 5 years ago

Looking at the Listener, it will automatically run the accepted validation whenever the last posted at is at least one day old. The configuration isn't even used, see:

https://github.com/FriendsOfFlarum/prevent-necrobumping/blob/9fa0b5b6d16790014e31cfbbec898983e805f48c/src/Listeners/ValidateNecrobumping.php#L36-L40

dsevillamartin commented 5 years ago

@luceos Seems like I did an Oops! while writing that code. Will look into it, thanks

luceos commented 5 years ago

Wanted to pr it. But didn't get the chance yet, sorry.