{"action":"created","issue":{"url":"https://api.github.com/repos/minetest/minetest/issues/7391","repository_url":"https://api.github.com/repos/minetest/minetest","labels_url":"https://api.github.com/repos/minetest/minetest/issues/7391/labels{/name}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/7391/comments","events_url":"https://api.github.com/repos/minetest/minetest/issues/7391/events","html_url":"https://github.com/minetest/minetest/issues/7391","id":328321429,"node_id":"MDU6SXNzdWUzMjgzMjE0Mjk=","number":7391,"title":"Add hidden formspec element","user":{"login":"Wuzzy2","id":1675853,"node_id":"MDQ6VXNlcjE2NzU4NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1675853?v=4","gravatar_id":"","url":"https://api.github.com/users/Wuzzy2","html_url":"https://github.com/Wuzzy2","followers_url":"https://api.github.com/users/Wuzzy2/followers","following_url":"https://api.github.com/users/Wuzzy2/following{/other_user}","gists_url":"https://api.github.com/users/Wuzzy2/gists{/gist_id}","starred_url":"https://api.github.com/users/Wuzzy2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wuzzy2/subscriptions","organizations_url":"https://api.github.com/users/Wuzzy2/orgs","repos_url":"https://api.github.com/users/Wuzzy2/repos","events_url":"https://api.github.com/users/Wuzzy2/events{/privacy}","received_events_url":"https://api.github.com/users/Wuzzy2/received_events","type":"User","site_admin":false},"labels":[{"id":73369003,"node_id":"MDU6TGFiZWw3MzM2OTAwMw==","url":"https://api.github.com/repos/minetest/minetest/labels/@%20Client%20/%20Audiovisuals","name":"@ Client / Audiovisuals","color":"0e8a16","default":false},{"id":108307769,"node_id":"MDU6TGFiZWwxMDgzMDc3Njk=","url":"https://api.github.com/repos/minetest/minetest/labels/Feature%20request","name":"Feature request","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-31T22:39:26Z","updated_at":"2018-06-01T08:03:19Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"##### Issue type\r\n - Feature request\r\n\r\n#### Summary\r\n\r\nI suggest to add a new formspec element: `hidden`. This is a formspec element which has two parameters, the first one being the name and the second one being the key. Both are arbitrary strings. This formspec element is not rendered, it is only internal.\r\n\r\nSyntax:\r\n\r\n```\r\n\"hidden[<key>;<value>]\"\r\n```\r\n\r\nWhen the formspec is received in one of the `formspec_receive` functions, the formspec element is always added into the `fields` table with `key` being the key and `value` being the value, both as strings.\r\n\r\nExample:\r\n\r\n```\r\n-- Embed a position in the formspec:\r\n\"hidden[positon;\"..minetest.formspec_escape(\"(34,2,-340)\")..\"]\"\r\n```\r\n\r\nThis would cause the `fields` table to look like this:\r\n\r\n```\r\nfields = {\r\n    [\"position\"] = \"(34,2,-340)\",\r\n}\r\n```\r\n\r\n### Rationale\r\n\r\nThis can be very useful to embed some kind of internal state into formspecs. This is mostly for convenience.\r\nThere were a few instances in my coding in which I would have really found such a `hidden` field useful.\r\n\r\nIn real GUI toolkits, hidden fields are also commonly used for the exact same reasons."},"comment":{"url":"https://api.github.com/repos/minetest/minetest/issues/comments/393800807","html_url":"https://github.com/minetest/minetest/issues/7391#issuecomment-393800807","issue_url":"https://api.github.com/repos/minetest/minetest/issues/7391","id":393800807,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzgwMDgwNw==","user":{"login":"nerzhul","id":119752,"node_id":"MDQ6VXNlcjExOTc1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/119752?v=4","gravatar_id":"","url":"https://api.github.com/users/nerzhul","html_url":"https://github.com/nerzhul","followers_url":"https://api.github.com/users/nerzhul/followers","following_url":"https://api.github.com/users/nerzhul/following{/other_user}","gists_url":"https://api.github.com/users/nerzhul/gists{/gist_id}","starred_url":"https://api.github.com/users/nerzhul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerzhul/subscriptions","organizations_url":"https://api.github.com/users/nerzhul/orgs","repos_url":"https://api.github.com/users/nerzhul/repos","events_url":"https://api.github.com/users/nerzhul/events{/privacy}","received_events_url":"https://api.github.com/users/nerzhul/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T08:03:19Z","updated_at":"2018-06-01T08:03:19Z","author_association":"MEMBER","body":"what is the interest of a such usecase ? a rogue client can easily modify it, try to cheat the server easily"}}
{"actor":{"display_login":"nerzhul"}}