{"action":"created","comment":{"url":"https://api.github.com/repos/inspircd/inspircd/pulls/comments/24837637","id":24837637,"diff_hunk":"@@ -0,0 +1,118 @@\n+/*\n+ * InspIRCd -- Internet Relay Chat Daemon\n+ *\n+ *   Copyright (C) 2014 Googolplexed <googol@googolplexed.net>\n+ *\n+ * This file is part of InspIRCd.  InspIRCd is free software: you can\n+ * redistribute it and/or modify it under the terms of the GNU General Public\n+ * License as published by the Free Software Foundation, version 2.\n+ *\n+ * This program is distributed in the hope that it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\n+ * details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+#include \"inspircd.h\"\n+#include \"caller.h\"\n+\n+class ModuleNationalCodePage : public Module,public HandlerBase1<bool, const std::string&>\n+{\n+\tcaller1<bool, const std::string&> rememberer;\n+\tconst unsigned char * lowermap_rememberer;\n+\tstd::bitset<256> m_allowedchar;\n+\tunsigned char m_casemap[256];\n+\tstd::string charset,casemapping;\n+\n+public:\n+\tModuleNationalCodePage()\n+\t\t: rememberer(ServerInstance->IsNick), lowermap_rememberer(national_case_insensitive_map) {\n+\t}\n+\n+\t//Check if Nick is valid using the current codepage\n+\tbool Call(const std::string& nick)\n+\t{\n+\t\tif(nick.length() > ServerInstance->Config->Limits.NickMax)\n+\t\t\treturn false;\n+\n+\t\tfor(std::string::const_iterator it = nick.begin(); it != nick.end(); ++it)\n+\t\t{\n+\t\t\t//Check if character in normal range\n+\t\t\tif ((*it >= 'A') && (*it <= '}'))\n+\t\t\t\tcontinue;\n+\n+\t\t\t//Check if character is okay, but needs to be after the initial\n+\t\t\tif ((((*it >= '0') && (*it <= '9')) || (*it == '-')) && (it != nick.begin()))\n+\t\t\t\tcontinue;\n+\n+\t\t\t//std::string's iterator returns signed chars.","path":"src/modules/m_nationalcodepage.cpp","position":50,"original_position":50,"commit_id":"d03ace378bd31a6dcc708abab5f285c9cfa5c75e","original_commit_id":"d03ace378bd31a6dcc708abab5f285c9cfa5c75e","user":{"login":"attilamolnar","id":1634220,"avatar_url":"https://avatars.githubusercontent.com/u/1634220?v=3","gravatar_id":"","url":"https://api.github.com/users/attilamolnar","html_url":"https://github.com/attilamolnar","followers_url":"https://api.github.com/users/attilamolnar/followers","following_url":"https://api.github.com/users/attilamolnar/following{/other_user}","gists_url":"https://api.github.com/users/attilamolnar/gists{/gist_id}","starred_url":"https://api.github.com/users/attilamolnar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/attilamolnar/subscriptions","organizations_url":"https://api.github.com/users/attilamolnar/orgs","repos_url":"https://api.github.com/users/attilamolnar/repos","events_url":"https://api.github.com/users/attilamolnar/events{/privacy}","received_events_url":"https://api.github.com/users/attilamolnar/received_events","type":"User","site_admin":false},"body":"Incorrect, the signedness of `char` is defined by the implementation","created_at":"2015-02-17T18:04:56Z","updated_at":"2015-02-17T18:04:56Z","html_url":"https://github.com/inspircd/inspircd/pull/902#discussion_r24837637","pull_request_url":"https://api.github.com/repos/inspircd/inspircd/pulls/902","_links":{"self":{"href":"https://api.github.com/repos/inspircd/inspircd/pulls/comments/24837637"},"html":{"href":"https://github.com/inspircd/inspircd/pull/902#discussion_r24837637"},"pull_request":{"href":"https://api.github.com/repos/inspircd/inspircd/pulls/902"}}},"pull_request":{"url":"https://api.github.com/repos/inspircd/inspircd/pulls/902","id":19380440,"html_url":"https://github.com/inspircd/inspircd/pull/902","diff_url":"https://github.com/inspircd/inspircd/pull/902.diff","patch_url":"https://github.com/inspircd/inspircd/pull/902.patch","issue_url":"https://api.github.com/repos/inspircd/inspircd/issues/902","number":902,"state":"open","locked":false,"title":"Replacement for m_nationalchars","user":{"login":"Googolplexed","id":1058937,"avatar_url":"https://avatars.githubusercontent.com/u/1058937?v=3","gravatar_id":"","url":"https://api.github.com/users/Googolplexed","html_url":"https://github.com/Googolplexed","followers_url":"https://api.github.com/users/Googolplexed/followers","following_url":"https://api.github.com/users/Googolplexed/following{/other_user}","gists_url":"https://api.github.com/users/Googolplexed/gists{/gist_id}","starred_url":"https://api.github.com/users/Googolplexed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Googolplexed/subscriptions","organizations_url":"https://api.github.com/users/Googolplexed/orgs","repos_url":"https://api.github.com/users/Googolplexed/repos","events_url":"https://api.github.com/users/Googolplexed/events{/privacy}","received_events_url":"https://api.github.com/users/Googolplexed/received_events","type":"User","site_admin":false},"body":"I've had this sitting around on my HDD for a while, it replaces m_nationalchars.\r\nUnpolished, but I've kinda forgotten what I was working on before putting it up here.\r\n\r\nMight want a few eyes on it, and such.","created_at":"2014-08-06T01:30:45Z","updated_at":"2015-02-17T18:04:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cadcf61ccd01b31407c4ed87cdc284bb9c239d62","assignee":null,"milestone":{"url":"https://api.github.com/repos/inspircd/inspircd/milestones/5","labels_url":"https://api.github.com/repos/inspircd/inspircd/milestones/5/labels","id":163203,"number":5,"title":"v2.2","description":null,"creator":{"login":"attilamolnar","id":1634220,"avatar_url":"https://avatars.githubusercontent.com/u/1634220?v=3","gravatar_id":"","url":"https://api.github.com/users/attilamolnar","html_url":"https://github.com/attilamolnar","followers_url":"https://api.github.com/users/attilamolnar/followers","following_url":"https://api.github.com/users/attilamolnar/following{/other_user}","gists_url":"https://api.github.com/users/attilamolnar/gists{/gist_id}","starred_url":"https://api.github.com/users/attilamolnar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/attilamolnar/subscriptions","organizations_url":"https://api.github.com/users/attilamolnar/orgs","repos_url":"https://api.github.com/users/attilamolnar/repos","events_url":"https://api.github.com/users/attilamolnar/events{/privacy}","received_events_url":"https://api.github.com/users/attilamolnar/received_events","type":"User","site_admin":false},"open_issues":49,"closed_issues":150,"state":"open","created_at":"2012-08-20T16:18:34Z","updated_at":"2015-02-05T23:17:09Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/inspircd/inspircd/pulls/902/commits","review_comments_url":"https://api.github.com/repos/inspircd/inspircd/pulls/902/comments","review_comment_url":"https://api.github.com/repos/inspircd/inspircd/pulls/comments/{number}","comments_url":"https://api.github.com/repos/inspircd/inspircd/issues/902/comments","statuses_url":"https://api.github.com/repos/inspircd/inspircd/statuses/d03ace378bd31a6dcc708abab5f285c9cfa5c75e","head":{"label":"Googolplexed:nationalchars1","ref":"nationalchars1","sha":"d03ace378bd31a6dcc708abab5f285c9cfa5c75e","user":{"login":"Googolplexed","id":1058937,"avatar_url":"https://avatars.githubusercontent.com/u/1058937?v=3","gravatar_id":"","url":"https://api.github.com/users/Googolplexed","html_url":"https://github.com/Googolplexed","followers_url":"https://api.github.com/users/Googolplexed/followers","following_url":"https://api.github.com/users/Googolplexed/following{/other_user}","gists_url":"https://api.github.com/users/Googolplexed/gists{/gist_id}","starred_url":"https://api.github.com/users/Googolplexed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Googolplexed/subscriptions","organizations_url":"https://api.github.com/users/Googolplexed/orgs","repos_url":"https://api.github.com/users/Googolplexed/repos","events_url":"https://api.github.com/users/Googolplexed/events{/privacy}","received_events_url":"https://api.github.com/users/Googolplexed/received_events","type":"User","site_admin":false},"repo":{"id":17102197,"name":"inspircd","full_name":"Googolplexed/inspircd","owner":{"login":"Googolplexed","id":1058937,"avatar_url":"https://avatars.githubusercontent.com/u/1058937?v=3","gravatar_id":"","url":"https://api.github.com/users/Googolplexed","html_url":"https://github.com/Googolplexed","followers_url":"https://api.github.com/users/Googolplexed/followers","following_url":"https://api.github.com/users/Googolplexed/following{/other_user}","gists_url":"https://api.github.com/users/Googolplexed/gists{/gist_id}","starred_url":"https://api.github.com/users/Googolplexed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Googolplexed/subscriptions","organizations_url":"https://api.github.com/users/Googolplexed/orgs","repos_url":"https://api.github.com/users/Googolplexed/repos","events_url":"https://api.github.com/users/Googolplexed/events{/privacy}","received_events_url":"https://api.github.com/users/Googolplexed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Googolplexed/inspircd","description":"Main inspircd repository.","fork":true,"url":"https://api.github.com/repos/Googolplexed/inspircd","forks_url":"https://api.github.com/repos/Googolplexed/inspircd/forks","keys_url":"https://api.github.com/repos/Googolplexed/inspircd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Googolplexed/inspircd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Googolplexed/inspircd/teams","hooks_url":"https://api.github.com/repos/Googolplexed/inspircd/hooks","issue_events_url":"https://api.github.com/repos/Googolplexed/inspircd/issues/events{/number}","events_url":"https://api.github.com/repos/Googolplexed/inspircd/events","assignees_url":"https://api.github.com/repos/Googolplexed/inspircd/assignees{/user}","branches_url":"https://api.github.com/repos/Googolplexed/inspircd/branches{/branch}","tags_url":"https://api.github.com/repos/Googolplexed/inspircd/tags","blobs_url":"https://api.github.com/repos/Googolplexed/inspircd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Googolplexed/inspircd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Googolplexed/inspircd/git/refs{/sha}","trees_url":"https://api.github.com/repos/Googolplexed/inspircd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Googolplexed/inspircd/statuses/{sha}","languages_url":"https://api.github.com/repos/Googolplexed/inspircd/languages","stargazers_url":"https://api.github.com/repos/Googolplexed/inspircd/stargazers","contributors_url":"https://api.github.com/repos/Googolplexed/inspircd/contributors","subscribers_url":"https://api.github.com/repos/Googolplexed/inspircd/subscribers","subscription_url":"https://api.github.com/repos/Googolplexed/inspircd/subscription","commits_url":"https://api.github.com/repos/Googolplexed/inspircd/commits{/sha}","git_commits_url":"https://api.github.com/repos/Googolplexed/inspircd/git/commits{/sha}","comments_url":"https://api.github.com/repos/Googolplexed/inspircd/comments{/number}","issue_comment_url":"https://api.github.com/repos/Googolplexed/inspircd/issues/comments/{number}","contents_url":"https://api.github.com/repos/Googolplexed/inspircd/contents/{+path}","compare_url":"https://api.github.com/repos/Googolplexed/inspircd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Googolplexed/inspircd/merges","archive_url":"https://api.github.com/repos/Googolplexed/inspircd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Googolplexed/inspircd/downloads","issues_url":"https://api.github.com/repos/Googolplexed/inspircd/issues{/number}","pulls_url":"https://api.github.com/repos/Googolplexed/inspircd/pulls{/number}","milestones_url":"https://api.github.com/repos/Googolplexed/inspircd/milestones{/number}","notifications_url":"https://api.github.com/repos/Googolplexed/inspircd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Googolplexed/inspircd/labels{/name}","releases_url":"https://api.github.com/repos/Googolplexed/inspircd/releases{/id}","created_at":"2014-02-23T05:17:54Z","updated_at":"2014-08-06T01:09:45Z","pushed_at":"2015-02-02T06:28:41Z","git_url":"git://github.com/Googolplexed/inspircd.git","ssh_url":"git@github.com:Googolplexed/inspircd.git","clone_url":"https://github.com/Googolplexed/inspircd.git","svn_url":"https://github.com/Googolplexed/inspircd","homepage":"http://inspircd.org","size":27050,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"inspircd:master","ref":"master","sha":"50ea7f41b2e4aca9ef9be31c056f862a7d90609a","user":{"login":"inspircd","id":1560750,"avatar_url":"https://avatars.githubusercontent.com/u/1560750?v=3","gravatar_id":"","url":"https://api.github.com/users/inspircd","html_url":"https://github.com/inspircd","followers_url":"https://api.github.com/users/inspircd/followers","following_url":"https://api.github.com/users/inspircd/following{/other_user}","gists_url":"https://api.github.com/users/inspircd/gists{/gist_id}","starred_url":"https://api.github.com/users/inspircd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inspircd/subscriptions","organizations_url":"https://api.github.com/users/inspircd/orgs","repos_url":"https://api.github.com/users/inspircd/repos","events_url":"https://api.github.com/users/inspircd/events{/privacy}","received_events_url":"https://api.github.com/users/inspircd/received_events","type":"Organization","site_admin":false},"repo":{"id":3786218,"name":"inspircd","full_name":"inspircd/inspircd","owner":{"login":"inspircd","id":1560750,"avatar_url":"https://avatars.githubusercontent.com/u/1560750?v=3","gravatar_id":"","url":"https://api.github.com/users/inspircd","html_url":"https://github.com/inspircd","followers_url":"https://api.github.com/users/inspircd/followers","following_url":"https://api.github.com/users/inspircd/following{/other_user}","gists_url":"https://api.github.com/users/inspircd/gists{/gist_id}","starred_url":"https://api.github.com/users/inspircd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inspircd/subscriptions","organizations_url":"https://api.github.com/users/inspircd/orgs","repos_url":"https://api.github.com/users/inspircd/repos","events_url":"https://api.github.com/users/inspircd/events{/privacy}","received_events_url":"https://api.github.com/users/inspircd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inspircd/inspircd","description":"Main inspircd repository.","fork":false,"url":"https://api.github.com/repos/inspircd/inspircd","forks_url":"https://api.github.com/repos/inspircd/inspircd/forks","keys_url":"https://api.github.com/repos/inspircd/inspircd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inspircd/inspircd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inspircd/inspircd/teams","hooks_url":"https://api.github.com/repos/inspircd/inspircd/hooks","issue_events_url":"https://api.github.com/repos/inspircd/inspircd/issues/events{/number}","events_url":"https://api.github.com/repos/inspircd/inspircd/events","assignees_url":"https://api.github.com/repos/inspircd/inspircd/assignees{/user}","branches_url":"https://api.github.com/repos/inspircd/inspircd/branches{/branch}","tags_url":"https://api.github.com/repos/inspircd/inspircd/tags","blobs_url":"https://api.github.com/repos/inspircd/inspircd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inspircd/inspircd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inspircd/inspircd/git/refs{/sha}","trees_url":"https://api.github.com/repos/inspircd/inspircd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inspircd/inspircd/statuses/{sha}","languages_url":"https://api.github.com/repos/inspircd/inspircd/languages","stargazers_url":"https://api.github.com/repos/inspircd/inspircd/stargazers","contributors_url":"https://api.github.com/repos/inspircd/inspircd/contributors","subscribers_url":"https://api.github.com/repos/inspircd/inspircd/subscribers","subscription_url":"https://api.github.com/repos/inspircd/inspircd/subscription","commits_url":"https://api.github.com/repos/inspircd/inspircd/commits{/sha}","git_commits_url":"https://api.github.com/repos/inspircd/inspircd/git/commits{/sha}","comments_url":"https://api.github.com/repos/inspircd/inspircd/comments{/number}","issue_comment_url":"https://api.github.com/repos/inspircd/inspircd/issues/comments/{number}","contents_url":"https://api.github.com/repos/inspircd/inspircd/contents/{+path}","compare_url":"https://api.github.com/repos/inspircd/inspircd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inspircd/inspircd/merges","archive_url":"https://api.github.com/repos/inspircd/inspircd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inspircd/inspircd/downloads","issues_url":"https://api.github.com/repos/inspircd/inspircd/issues{/number}","pulls_url":"https://api.github.com/repos/inspircd/inspircd/pulls{/number}","milestones_url":"https://api.github.com/repos/inspircd/inspircd/milestones{/number}","notifications_url":"https://api.github.com/repos/inspircd/inspircd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inspircd/inspircd/labels{/name}","releases_url":"https://api.github.com/repos/inspircd/inspircd/releases{/id}","created_at":"2012-03-21T12:22:32Z","updated_at":"2015-02-15T12:21:45Z","pushed_at":"2015-02-17T15:10:05Z","git_url":"git://github.com/inspircd/inspircd.git","ssh_url":"git@github.com:inspircd/inspircd.git","clone_url":"https://github.com/inspircd/inspircd.git","svn_url":"https://github.com/inspircd/inspircd","homepage":"http://inspircd.org","size":35924,"stargazers_count":324,"watchers_count":324,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":116,"mirror_url":null,"open_issues_count":161,"forks":116,"open_issues":161,"watchers":324,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inspircd/inspircd/pulls/902"},"html":{"href":"https://github.com/inspircd/inspircd/pull/902"},"issue":{"href":"https://api.github.com/repos/inspircd/inspircd/issues/902"},"comments":{"href":"https://api.github.com/repos/inspircd/inspircd/issues/902/comments"},"review_comments":{"href":"https://api.github.com/repos/inspircd/inspircd/pulls/902/comments"},"review_comment":{"href":"https://api.github.com/repos/inspircd/inspircd/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/inspircd/inspircd/pulls/902/commits"},"statuses":{"href":"https://api.github.com/repos/inspircd/inspircd/statuses/d03ace378bd31a6dcc708abab5f285c9cfa5c75e"}}}}