Jannyscript completed

I got the jannyscript working bros

What is jannyscript?

It’s new way of moderation. Whatever mopping activity the janny does, it’s logged like a regular post. This puts jannies’ wickedness to the light.

A regular post is posted like this:

{
	"board":"c",
	"parent":1,
    "preclaims": [
        {
            "id": 1,
            "type": "text/plain",
            "content":"what's wrong with sucking cute dicks, homophobe",
            "is_embeded":true
        },
        {
            "id": 2,
            "type": "image/jpeg",
            "length":1234212
        }
    ]
}

If janny wants to delete this post, he does it like this

{
	"board":"c",
	"parent":1,
    "preclaims": [
        {
            "id": 1,
            "type": "text/plain",
            "content":"homophobe? nobody's afraid of you, stop making up words, cringe, homophobe more like faggotcope, fucking sodomite get off 4Chad",
            "is_embeded":true
        },
        {
        	"id":2,
        	"type":"application/4chad.jannyscript",
        	"is_embeded":true,
        	"content":"{\"command\":\"delete:post\",\"board\":\"c\",\"height\":4}"
        }
    ]
}

notice the added

{
    "id":2,
    "type":"application/4chad.jannyscript",
    "is_embeded":true,
    "content":"{\"command\":\"delete:post\",\"board\":\"c\",\"height\":4}"
}

So the action of the jannie is just a piece of content like everything else queryable, but with the Content-Type of application/4chad.jannyscript. If a jannie provides login credentials, the jannyscript is picked up by the server and executed.

And of course, a janny cannot delete his own mop trails.(later I found out how to abuse this feature. if jannies’ posts are immutable, and a janny is a troll, then he could post some vile shit and it couldn’t be deleted. and the solution came out so perfectly, as the mechanism was envisioned in the first place. a post can’t be deleted unless a delete issuing post was posted, this means a janny can mop its own mop trail, but he will leave a mop trail by mopping it)

Interesting thing happened when I was developing jannyscript.

When I first implemented the janniescript delete function, the post height of the test server returned 66. Is this devil’s mark I thought? Then the function failed. I cleaned the bugs, and upon the first successful implementation of janniescript delete, the test server post height was 71. I think these numbers mean something. Praise the LORD.

Then when the posts are displayed the server returns:

{
    "height": 10,
    "board": "c",
    "janny": {
        "profile": {
            "name": "janny1",
            "id": "2724a7f4-f84f-78d5-1a1e-cf3a121b7380",
            "email": "janny@example.com"
        },
        "permissions": [
            "delete:post",
            "nocaptcha"
        ]
    },
    "contents": [
        {
            "length": 48,
            "is_embeded": "true",
            "id": 2,
            "content": "{\"command\":\"delete:post\",\"board\":\"c\",\"height\":4}",
            "type": "application/4chad.jannyscript"
        },
        {
            "length": 118,
            "is_embeded": "true",
            "id": 1,
            "content": "homophobe? nobody's afraid of you, stop making up words, cringe, more like faggotcope, fucking sodomite get off 4Chad",
            "type": "text/plain"
        }
    ],
    "rank": 6
}

As you can see, the delete command is public