{"action":"created","comment":{"url":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/comments/42316414","id":42316414,"diff_hunk":"@@ -241,12 +247,40 @@ class IrcClient\n \t\tsocket.send(\"\\r\\n\"); // TODO: should be in one call to send?\n \t}\n \n+\tenum additionalMsgLens{\n+\t\tPRIVMSG=MAX_USERHOST_LEN,\n+\t\tNOTICE=MAX_USERHOST_LEN\n+\t}\n+\t\n+\t/**\n+\t * Returns the additional lengthrequirements of a method.\n+\t * \n+\t * Params:\n+\t * \tmethod = The method to query.\n+\t * Returns:\n+\t * \tThe additional lengthrequirements.\n+\t */\n+\tprivate static uint additionalMsgLen(string method)(){","path":"irc/client.d","position":30,"original_position":30,"commit_id":"826e9b076e9c8fe99d6b24bec1f4f19f173c7e6a","original_commit_id":"826e9b076e9c8fe99d6b24bec1f4f19f173c7e6a","user":{"login":"JakobOvrum","id":155856,"avatar_url":"https://avatars.githubusercontent.com/u/155856?v=3","gravatar_id":"","url":"https://api.github.com/users/JakobOvrum","html_url":"https://github.com/JakobOvrum","followers_url":"https://api.github.com/users/JakobOvrum/followers","following_url":"https://api.github.com/users/JakobOvrum/following{/other_user}","gists_url":"https://api.github.com/users/JakobOvrum/gists{/gist_id}","starred_url":"https://api.github.com/users/JakobOvrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakobOvrum/subscriptions","organizations_url":"https://api.github.com/users/JakobOvrum/orgs","repos_url":"https://api.github.com/users/JakobOvrum/repos","events_url":"https://api.github.com/users/JakobOvrum/events{/privacy}","received_events_url":"https://api.github.com/users/JakobOvrum/received_events","type":"User","site_admin":false},"body":"This can just be a template, no need for a function:\r\n```d\r\ntemplate additionalMsgLen(string method)\r\n{\r\n    static if(staticIndexOf!(method, __traits(allMembers, AdditionalMsgLens)) == -1)\r\n        return 0;\r\n    else\r\n        enum additionalMsgLen = mixin(\"additionalMsgLens.\" ~ method);\r\n}\r\n```\r\nThe tests can be static asserts:\r\n```d\r\nstatic assert(additionalMsgLen!\"PRIVMSG\" == MAX_USERHOST_LEN);\r\n...\r\n```","created_at":"2015-10-18T02:22:27Z","updated_at":"2015-10-18T02:22:27Z","html_url":"https://github.com/JakobOvrum/Dirk/pull/16#discussion_r42316414","pull_request_url":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/comments/42316414"},"html":{"href":"https://github.com/JakobOvrum/Dirk/pull/16#discussion_r42316414"},"pull_request":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/16","id":47997232,"html_url":"https://github.com/JakobOvrum/Dirk/pull/16","diff_url":"https://github.com/JakobOvrum/Dirk/pull/16.diff","patch_url":"https://github.com/JakobOvrum/Dirk/pull/16.patch","issue_url":"https://api.github.com/repos/JakobOvrum/Dirk/issues/16","number":16,"state":"open","locked":false,"title":"Improve linesplitting flaw","user":{"login":"Doeme","id":2459235,"avatar_url":"https://avatars.githubusercontent.com/u/2459235?v=3","gravatar_id":"","url":"https://api.github.com/users/Doeme","html_url":"https://github.com/Doeme","followers_url":"https://api.github.com/users/Doeme/followers","following_url":"https://api.github.com/users/Doeme/following{/other_user}","gists_url":"https://api.github.com/users/Doeme/gists{/gist_id}","starred_url":"https://api.github.com/users/Doeme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doeme/subscriptions","organizations_url":"https://api.github.com/users/Doeme/orgs","repos_url":"https://api.github.com/users/Doeme/repos","events_url":"https://api.github.com/users/Doeme/events{/privacy}","received_events_url":"https://api.github.com/users/Doeme/received_events","type":"User","site_admin":false},"body":"See issue https://github.com/JakobOvrum/Dirk/issues/15","created_at":"2015-10-17T22:53:51Z","updated_at":"2015-10-18T02:22:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b67e49b0e7a5a8a0835c1ed8860aee9b6ca162e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/16/commits","review_comments_url":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/16/comments","review_comment_url":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JakobOvrum/Dirk/issues/16/comments","statuses_url":"https://api.github.com/repos/JakobOvrum/Dirk/statuses/826e9b076e9c8fe99d6b24bec1f4f19f173c7e6a","head":{"label":"Doeme:master","ref":"master","sha":"826e9b076e9c8fe99d6b24bec1f4f19f173c7e6a","user":{"login":"Doeme","id":2459235,"avatar_url":"https://avatars.githubusercontent.com/u/2459235?v=3","gravatar_id":"","url":"https://api.github.com/users/Doeme","html_url":"https://github.com/Doeme","followers_url":"https://api.github.com/users/Doeme/followers","following_url":"https://api.github.com/users/Doeme/following{/other_user}","gists_url":"https://api.github.com/users/Doeme/gists{/gist_id}","starred_url":"https://api.github.com/users/Doeme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doeme/subscriptions","organizations_url":"https://api.github.com/users/Doeme/orgs","repos_url":"https://api.github.com/users/Doeme/repos","events_url":"https://api.github.com/users/Doeme/events{/privacy}","received_events_url":"https://api.github.com/users/Doeme/received_events","type":"User","site_admin":false},"repo":{"id":43605955,"name":"Dirk","full_name":"Doeme/Dirk","owner":{"login":"Doeme","id":2459235,"avatar_url":"https://avatars.githubusercontent.com/u/2459235?v=3","gravatar_id":"","url":"https://api.github.com/users/Doeme","html_url":"https://github.com/Doeme","followers_url":"https://api.github.com/users/Doeme/followers","following_url":"https://api.github.com/users/Doeme/following{/other_user}","gists_url":"https://api.github.com/users/Doeme/gists{/gist_id}","starred_url":"https://api.github.com/users/Doeme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doeme/subscriptions","organizations_url":"https://api.github.com/users/Doeme/orgs","repos_url":"https://api.github.com/users/Doeme/repos","events_url":"https://api.github.com/users/Doeme/events{/privacy}","received_events_url":"https://api.github.com/users/Doeme/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Doeme/Dirk","description":"IRC library for the D programming language","fork":true,"url":"https://api.github.com/repos/Doeme/Dirk","forks_url":"https://api.github.com/repos/Doeme/Dirk/forks","keys_url":"https://api.github.com/repos/Doeme/Dirk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Doeme/Dirk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Doeme/Dirk/teams","hooks_url":"https://api.github.com/repos/Doeme/Dirk/hooks","issue_events_url":"https://api.github.com/repos/Doeme/Dirk/issues/events{/number}","events_url":"https://api.github.com/repos/Doeme/Dirk/events","assignees_url":"https://api.github.com/repos/Doeme/Dirk/assignees{/user}","branches_url":"https://api.github.com/repos/Doeme/Dirk/branches{/branch}","tags_url":"https://api.github.com/repos/Doeme/Dirk/tags","blobs_url":"https://api.github.com/repos/Doeme/Dirk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Doeme/Dirk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Doeme/Dirk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Doeme/Dirk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Doeme/Dirk/statuses/{sha}","languages_url":"https://api.github.com/repos/Doeme/Dirk/languages","stargazers_url":"https://api.github.com/repos/Doeme/Dirk/stargazers","contributors_url":"https://api.github.com/repos/Doeme/Dirk/contributors","subscribers_url":"https://api.github.com/repos/Doeme/Dirk/subscribers","subscription_url":"https://api.github.com/repos/Doeme/Dirk/subscription","commits_url":"https://api.github.com/repos/Doeme/Dirk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Doeme/Dirk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Doeme/Dirk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Doeme/Dirk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Doeme/Dirk/contents/{+path}","compare_url":"https://api.github.com/repos/Doeme/Dirk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Doeme/Dirk/merges","archive_url":"https://api.github.com/repos/Doeme/Dirk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Doeme/Dirk/downloads","issues_url":"https://api.github.com/repos/Doeme/Dirk/issues{/number}","pulls_url":"https://api.github.com/repos/Doeme/Dirk/pulls{/number}","milestones_url":"https://api.github.com/repos/Doeme/Dirk/milestones{/number}","notifications_url":"https://api.github.com/repos/Doeme/Dirk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Doeme/Dirk/labels{/name}","releases_url":"https://api.github.com/repos/Doeme/Dirk/releases{/id}","created_at":"2015-10-03T16:39:05Z","updated_at":"2015-10-03T16:39:06Z","pushed_at":"2015-10-17T23:13:08Z","git_url":"git://github.com/Doeme/Dirk.git","ssh_url":"git@github.com:Doeme/Dirk.git","clone_url":"https://github.com/Doeme/Dirk.git","svn_url":"https://github.com/Doeme/Dirk","homepage":"http://jakobovrum.github.io/Dirk/","size":426,"stargazers_count":0,"watchers_count":0,"language":"D","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JakobOvrum:master","ref":"master","sha":"ce4f67445ba3562cfb220c61240d0f67a5b21bf1","user":{"login":"JakobOvrum","id":155856,"avatar_url":"https://avatars.githubusercontent.com/u/155856?v=3","gravatar_id":"","url":"https://api.github.com/users/JakobOvrum","html_url":"https://github.com/JakobOvrum","followers_url":"https://api.github.com/users/JakobOvrum/followers","following_url":"https://api.github.com/users/JakobOvrum/following{/other_user}","gists_url":"https://api.github.com/users/JakobOvrum/gists{/gist_id}","starred_url":"https://api.github.com/users/JakobOvrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakobOvrum/subscriptions","organizations_url":"https://api.github.com/users/JakobOvrum/orgs","repos_url":"https://api.github.com/users/JakobOvrum/repos","events_url":"https://api.github.com/users/JakobOvrum/events{/privacy}","received_events_url":"https://api.github.com/users/JakobOvrum/received_events","type":"User","site_admin":false},"repo":{"id":5165441,"name":"Dirk","full_name":"JakobOvrum/Dirk","owner":{"login":"JakobOvrum","id":155856,"avatar_url":"https://avatars.githubusercontent.com/u/155856?v=3","gravatar_id":"","url":"https://api.github.com/users/JakobOvrum","html_url":"https://github.com/JakobOvrum","followers_url":"https://api.github.com/users/JakobOvrum/followers","following_url":"https://api.github.com/users/JakobOvrum/following{/other_user}","gists_url":"https://api.github.com/users/JakobOvrum/gists{/gist_id}","starred_url":"https://api.github.com/users/JakobOvrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakobOvrum/subscriptions","organizations_url":"https://api.github.com/users/JakobOvrum/orgs","repos_url":"https://api.github.com/users/JakobOvrum/repos","events_url":"https://api.github.com/users/JakobOvrum/events{/privacy}","received_events_url":"https://api.github.com/users/JakobOvrum/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JakobOvrum/Dirk","description":"IRC library for the D programming language","fork":false,"url":"https://api.github.com/repos/JakobOvrum/Dirk","forks_url":"https://api.github.com/repos/JakobOvrum/Dirk/forks","keys_url":"https://api.github.com/repos/JakobOvrum/Dirk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JakobOvrum/Dirk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JakobOvrum/Dirk/teams","hooks_url":"https://api.github.com/repos/JakobOvrum/Dirk/hooks","issue_events_url":"https://api.github.com/repos/JakobOvrum/Dirk/issues/events{/number}","events_url":"https://api.github.com/repos/JakobOvrum/Dirk/events","assignees_url":"https://api.github.com/repos/JakobOvrum/Dirk/assignees{/user}","branches_url":"https://api.github.com/repos/JakobOvrum/Dirk/branches{/branch}","tags_url":"https://api.github.com/repos/JakobOvrum/Dirk/tags","blobs_url":"https://api.github.com/repos/JakobOvrum/Dirk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JakobOvrum/Dirk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JakobOvrum/Dirk/git/refs{/sha}","trees_url":"https://api.github.com/repos/JakobOvrum/Dirk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JakobOvrum/Dirk/statuses/{sha}","languages_url":"https://api.github.com/repos/JakobOvrum/Dirk/languages","stargazers_url":"https://api.github.com/repos/JakobOvrum/Dirk/stargazers","contributors_url":"https://api.github.com/repos/JakobOvrum/Dirk/contributors","subscribers_url":"https://api.github.com/repos/JakobOvrum/Dirk/subscribers","subscription_url":"https://api.github.com/repos/JakobOvrum/Dirk/subscription","commits_url":"https://api.github.com/repos/JakobOvrum/Dirk/commits{/sha}","git_commits_url":"https://api.github.com/repos/JakobOvrum/Dirk/git/commits{/sha}","comments_url":"https://api.github.com/repos/JakobOvrum/Dirk/comments{/number}","issue_comment_url":"https://api.github.com/repos/JakobOvrum/Dirk/issues/comments{/number}","contents_url":"https://api.github.com/repos/JakobOvrum/Dirk/contents/{+path}","compare_url":"https://api.github.com/repos/JakobOvrum/Dirk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JakobOvrum/Dirk/merges","archive_url":"https://api.github.com/repos/JakobOvrum/Dirk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JakobOvrum/Dirk/downloads","issues_url":"https://api.github.com/repos/JakobOvrum/Dirk/issues{/number}","pulls_url":"https://api.github.com/repos/JakobOvrum/Dirk/pulls{/number}","milestones_url":"https://api.github.com/repos/JakobOvrum/Dirk/milestones{/number}","notifications_url":"https://api.github.com/repos/JakobOvrum/Dirk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JakobOvrum/Dirk/labels{/name}","releases_url":"https://api.github.com/repos/JakobOvrum/Dirk/releases{/id}","created_at":"2012-07-24T12:50:29Z","updated_at":"2015-08-27T09:43:18Z","pushed_at":"2015-10-17T23:13:08Z","git_url":"git://github.com/JakobOvrum/Dirk.git","ssh_url":"git@github.com:JakobOvrum/Dirk.git","clone_url":"https://github.com/JakobOvrum/Dirk.git","svn_url":"https://github.com/JakobOvrum/Dirk","homepage":"http://jakobovrum.github.io/Dirk/","size":996,"stargazers_count":22,"watchers_count":22,"language":"D","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":8,"forks":6,"open_issues":8,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/16"},"html":{"href":"https://github.com/JakobOvrum/Dirk/pull/16"},"issue":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/issues/16"},"comments":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/JakobOvrum/Dirk/statuses/826e9b076e9c8fe99d6b24bec1f4f19f173c7e6a"}}}}