Post_type explanation request
-
I poked through the database. I searched the source code. The only sane reference to
post_type
(which is passed in JSON of every single post) is this:"post_types":{"regular":1,"moderator_action":2}
So... Is that all? What is it? Is it just a flag to indicate moderator actions should be enabled? I expected it to mark posts that are wikified, pending for deletion, possibly PMs. But this is all I got.
So... am I right? Completely wrong? Am I allowed to know the true meaning if I'm wrong?
Paging @riking!
-
moderator_action
might be for those 'topic has been locked' posts and the like.Get the JSON for a short OnePost topic, and have a look ;)
-
Makes sense. Still doesn't explain why there are only two values.
To me, the name implies it will have more meanings. For locked posts I'd expect
post_locked
or something.Might be just poor naming and it could be that. But I'd rather hear it from the horse's mouth.
-
moderator_action might be for those 'topic has been locked' posts and the like.
Post seems the wrong level for that - seems like it's maybe more for wiki or staff colour?
That's all a WAG.
-
To me, the name implies it will have more meanings. For locked posts I'd expect post_locked or something.
I'd expectlocked
to be a flag myself.
Two post types kinda makes sense; you have normal posts, andabnormalmoderator action posts
-
Well, the @RaceProUK's guess was close, if not completely correct:
http://what.thedailywtf.com/t/anket-test/7922.json
@system's post has
post_type: 2
.I'm gonna go find a topic with moved posts...
-
-
ahem
@loopback0 said:staff colour?
Well, he was first :P
http://what.thedailywtf.com/t/high-quality-religious-visitation/7905.json
Second post is you moving posts. It has
post_type: 2
as well. Oh well, I guess that could be it.Wait... Why did that onebox?
http://what.thedailywtf.com/t/high-quality-religious-visitation/7905.json
Ummm.. dare I summon @discoursebot ?
-
@Onyx - Days Since Last Discourse Bug: 0
-
Out of interest...
http://what.thedailywtf.com/t/teh-o-cial-discopaedia-abarker-creator-and-prophet-of-the-discopaedia/3866.json
Posts have
wiki: true
.DISCOURSISTENCY!
-
Might be just poor naming and it could be that. But I'd rather hear it from the horse's mouth.
Here you have it
-
Yes, that's definitely the staff color flag. If you dig through the source, the
togglePostType
action gets called when some admin button is clicked, and it changes the value betweenregular
andmoderator_action
.
-
I expected it to mark posts that are wikified, pending for deletion, possibly PMs. But this is all I got.
You're a funny guy. That's, if I remember correctly, an archetype.
-
Yes, that's definitely the staff color flag
Because I felt like posting that image
-
Oh, goodie. Guess I was focusing too much on ruby models expecting it to be there. But nope, should've looked in JS.
You're a funny guy. That's, if I remember correctly, an archetype.
And that's why you can find it in
post_archetype
param...Posts have wiki: true.
Right.
-
Remember that as per the Jeffinition, TL4 are not staff but can perform actions which are staff actions and thus get the staff colour.
-
Right.
Yeah, so
wiki
is a flag,post_type
is also a flag regarding staff color, and PMs and polls are archetypes.I... think. I'm confused now.
-
wiki is a flag, post_type is also a flag regarding staff color, and PMs and polls are archetypes.
Discourse
-
I... think. I'm confused now.
when in doubt always check the documentation.
oh right... Discourse
-
Remember that as per the Jeffinition, TL4 are not staff but can perform actions which are staff actions and thus get the staff colour.
Well, at least
post_type
will be set properly, so I hope it won't matter anyway.Yeah, so wiki is a flag, post_type is also a flag regarding staff color, and PMs and polls are archetypes.
I... think. I'm confused now.
Yeah, I think I'm putting all this shit we figure out in a wiki along with my code once I get it on GitHub. Or just make a separate one. Well, next weekend, most likely, right now I need to get some sleep.
-
Well, guess that's the answer for "can we get a documented API please?".
Yeah, I think I'm putting all this shit we figure out in a wiki along with my code once I get it on GitHub. Or just make a separate one.
Good thinking. I hope to be taking off with Discoursistency once I'm done with thesis paperwork, so I'll try to be of some use.
-
http://blog.codinghorror.com/learn-to-read-the-source-luke/
Well, guess that's the answer for "can we get a documented API please?".
If I asked someone for documentation, and they told me to read the source, I'd break out the ClueBatâ„¢.Seriously, learn to write documentation. It's nowhere near as difficult as some make it out to be.
-
It's a failure to YAGNI. It makes posts have the staff color if it's 2.
-
It's a failure
Indeed.
to YAGNI.
If only it was just that...
I mean, Discourse is Discourse, it has its better and worse moments, but the JSON API is a total clusterfuck. Which is sad, because it's pretty much feature-complete and would make a powerful tool if cleaned up and documented. But instead, we get this.
-
-
No, Discourse comes from the other end of the horse.
No, What comes of the other end of the horse is actually useful. therefor
-
Of course, it's the high margins they make on the manure which allows them to make such impressive deals on the horse in the first place—that's how they get you.
Filed under: or is that laserjet printers?, I always get those confused...
-
Of course, it's the high margins they make on the manure which allows them to make such impressive deals on the horse in the first place—that's how they get you.
Filed under: or is that laserjet printers, I always get those confused...I don't know about you, but my HP Deskjet is running in the 3:50, and we're hoping for a placing this time…
-