{"action":"created","issue":{"url":"https://api.github.com/repos/ssbc/secure-scuttlebutt/issues/94","labels_url":"https://api.github.com/repos/ssbc/secure-scuttlebutt/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/ssbc/secure-scuttlebutt/issues/94/comments","events_url":"https://api.github.com/repos/ssbc/secure-scuttlebutt/issues/94/events","html_url":"https://github.com/ssbc/secure-scuttlebutt/issues/94","id":58489993,"number":94,"title":"A more constrained link definition in message objects","user":{"login":"pfraze","id":1270099,"avatar_url":"https://avatars.githubusercontent.com/u/1270099?v=3","gravatar_id":"","url":"https://api.github.com/users/pfraze","html_url":"https://github.com/pfraze","followers_url":"https://api.github.com/users/pfraze/followers","following_url":"https://api.github.com/users/pfraze/following{/other_user}","gists_url":"https://api.github.com/users/pfraze/gists{/gist_id}","starred_url":"https://api.github.com/users/pfraze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfraze/subscriptions","organizations_url":"https://api.github.com/users/pfraze/orgs","repos_url":"https://api.github.com/users/pfraze/repos","events_url":"https://api.github.com/users/pfraze/events{/privacy}","received_events_url":"https://api.github.com/users/pfraze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-02-22T04:36:25Z","updated_at":"2015-03-10T22:01:01Z","closed_at":null,"body":"per discussion on irc, \r\nThe `rel` attribute on links seems burdensome when we can just put links in sub-objects and infer the rel-type from the attribute name. I believe @dominictarr feels the same.\r\n\r\nWe discussed -and I now propose -we restrict links from appearing in the top object, and remove the `rel` attribute instead. A sub-object will then be determined to be a link by looking for `feed`, `msg`, and `ext`, which may be used in any combination on the sub-object. The relation type will be the key of the sub-object in its immediate parent.\r\n\r\nFor example, this message --\r\n\r\n```json\r\n  \"content\": {\r\n    \"type\": \"post\",\r\n    \"text\": \"hello @dominic\",\r\n    \"repliesTo\": {\r\n      \"msg\": \"xhoAEBPnmEN2+kfTYrUrb6G0Q/Nc7x9lc0WB9UskoGk=.blake2s\",\r\n      \"rel\": \"replies-to\"\r\n    },\r\n    \"mentions\": [\r\n      {\r\n        \"feed\": \"wuDDnMxVtk8U9hrueDj/T0itgp5HJZ4ZDEJodTyoMdg=.blake2s\",\r\n        \"rel\": \"mentions\",\r\n        \"name\": \"dominic\"\r\n      }\r\n    ]\r\n  }\r\n```\r\n\r\nchanges to--\r\n\r\n```json\r\n  \"content\": {\r\n    \"type\": \"post\",\r\n    \"text\": \"hello @dominic\",\r\n    \"repliesTo\": {\r\n      \"msg\": \"xhoAEBPnmEN2+kfTYrUrb6G0Q/Nc7x9lc0WB9UskoGk=.blake2s\"\r\n    },\r\n    \"mentions\": [\r\n      {\r\n        \"feed\": \"wuDDnMxVtk8U9hrueDj/T0itgp5HJZ4ZDEJodTyoMdg=.blake2s\",\r\n        \"name\": \"dominic\"\r\n      }\r\n    ]\r\n  }\r\n```\r\n\r\nIn this case, it is structurally similar -- it's only dropped the `rel`. Other messages will have to change structure. For instance:\r\n\r\n```json\r\n\"content\": {\r\n  \"type\": \"follow\",\r\n  \"rel\": \"follows\",\r\n  \"feed\": \"wuDDnMxVtk8U9hrueDj/T0itgp5HJZ4ZDEJodTyoMdg=.blake2s\"\r\n}\r\n```\r\n\r\nWill become\r\n\r\n```json\r\n\"content\": {\r\n  \"type\": \"follow\",\r\n  \"follows\": {\r\n    \"feed\": \"wuDDnMxVtk8U9hrueDj/T0itgp5HJZ4ZDEJodTyoMdg=.blake2s\"\r\n  }\r\n}\r\n```\r\n\r\n--\r\n\r\nAs an aside, I'm also considering a semantic refactor for the message types, in which case follow may become something more like:\r\n\r\n```json\r\n\"content\": {\r\n  \"type\": \"follow\",\r\n  \"newFriend\": {\r\n    \"feed\": \"wuDDnMxVtk8U9hrueDj/T0itgp5HJZ4ZDEJodTyoMdg=.blake2s\"\r\n  }\r\n}\r\n// and for unfollow:\r\n\"content\": {\r\n  \"type\": \"unfollow\",\r\n  \"oldFriend\": {\r\n    \"feed\": \"wuDDnMxVtk8U9hrueDj/T0itgp5HJZ4ZDEJodTyoMdg=.blake2s\"\r\n  }\r\n}\r\n```\r\n\r\nBut that's not related to this topic (unless we want it to be)"},"comment":{"url":"https://api.github.com/repos/ssbc/secure-scuttlebutt/issues/comments/78158105","html_url":"https://github.com/ssbc/secure-scuttlebutt/issues/94#issuecomment-78158105","issue_url":"https://api.github.com/repos/ssbc/secure-scuttlebutt/issues/94","id":78158105,"user":{"login":"pfraze","id":1270099,"avatar_url":"https://avatars.githubusercontent.com/u/1270099?v=3","gravatar_id":"","url":"https://api.github.com/users/pfraze","html_url":"https://github.com/pfraze","followers_url":"https://api.github.com/users/pfraze/followers","following_url":"https://api.github.com/users/pfraze/following{/other_user}","gists_url":"https://api.github.com/users/pfraze/gists{/gist_id}","starred_url":"https://api.github.com/users/pfraze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfraze/subscriptions","organizations_url":"https://api.github.com/users/pfraze/orgs","repos_url":"https://api.github.com/users/pfraze/repos","events_url":"https://api.github.com/users/pfraze/events{/privacy}","received_events_url":"https://api.github.com/users/pfraze/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T22:01:01Z","updated_at":"2015-03-10T22:01:01Z","body":"@dominictarr this has been fully implemented, close issue?"}}