{"action":"created","comment":{"url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/comments/90722410","pull_request_review_id":11243114,"id":90722410,"diff_hunk":"@@ -262,12 +265,19 @@ bool CClientBufferMod::ParseMessage(const CString& line, CNick& nick, CString& c\n     return !target.empty() && !cmd.empty();\n }\n \n+// returns true if the new timestamp was successfully written to disk\n+bool CClientBufferMod::SetTimestamp(const CString& identifier, const CString& target, const timeval& tv)\n+{\n+    char timestamp[32];\n+    std::snprintf(timestamp, 32, \"%ld.%06ld\", tv.tv_sec, tv.tv_usec);\n+    return SetNV(identifier + \"/\" + target, timestamp);\n+}\n+\n timeval CClientBufferMod::GetTimestamp(const CString& identifier, const CString& target)\n {\n     timeval tv;\n-    double timestamp = GetNV(identifier + \"/\" + target).ToDouble();\n-    tv.tv_sec = timestamp;\n-    tv.tv_usec = (timestamp - tv.tv_sec) * 1000000;\n+    CString timestamp = GetNV(identifier + \"/\" + target);\n+    std::sscanf(timestamp.c_str(), \"%ld.%06ld\", &tv.tv_sec, &tv.tv_usec);","path":"clientbuffer.cpp","position":43,"original_position":43,"commit_id":"af4cdff9fda5683a923744b065e53af34eb71d76","original_commit_id":"af4cdff9fda5683a923744b065e53af34eb71d76","user":{"login":"CyberShadow","id":160894,"avatar_url":"https://avatars.githubusercontent.com/u/160894?v=3","gravatar_id":"","url":"https://api.github.com/users/CyberShadow","html_url":"https://github.com/CyberShadow","followers_url":"https://api.github.com/users/CyberShadow/followers","following_url":"https://api.github.com/users/CyberShadow/following{/other_user}","gists_url":"https://api.github.com/users/CyberShadow/gists{/gist_id}","starred_url":"https://api.github.com/users/CyberShadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyberShadow/subscriptions","organizations_url":"https://api.github.com/users/CyberShadow/orgs","repos_url":"https://api.github.com/users/CyberShadow/repos","events_url":"https://api.github.com/users/CyberShadow/events{/privacy}","received_events_url":"https://api.github.com/users/CyberShadow/received_events","type":"User","site_admin":false},"body":"This seems to assume that `time_t` is 64-bit.","created_at":"2016-12-02T21:24:50Z","updated_at":"2016-12-02T21:24:50Z","html_url":"https://github.com/jpnurmi/znc-clientbuffer/pull/7#discussion_r90722410","pull_request_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/comments/90722410"},"html":{"href":"https://github.com/jpnurmi/znc-clientbuffer/pull/7#discussion_r90722410"},"pull_request":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/7","id":83548618,"html_url":"https://github.com/jpnurmi/znc-clientbuffer/pull/7","diff_url":"https://github.com/jpnurmi/znc-clientbuffer/pull/7.diff","patch_url":"https://github.com/jpnurmi/znc-clientbuffer/pull/7.patch","issue_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/issues/7","number":7,"state":"open","locked":false,"title":"correct reading/writing of complete unix timestamps","user":{"login":"blole","id":651644,"avatar_url":"https://avatars.githubusercontent.com/u/651644?v=3","gravatar_id":"","url":"https://api.github.com/users/blole","html_url":"https://github.com/blole","followers_url":"https://api.github.com/users/blole/followers","following_url":"https://api.github.com/users/blole/following{/other_user}","gists_url":"https://api.github.com/users/blole/gists{/gist_id}","starred_url":"https://api.github.com/users/blole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blole/subscriptions","organizations_url":"https://api.github.com/users/blole/orgs","repos_url":"https://api.github.com/users/blole/repos","events_url":"https://api.github.com/users/blole/events{/privacy}","received_events_url":"https://api.github.com/users/blole/received_events","type":"User","site_admin":false},"body":"Previously timestamps saved with SetNV() were truncated to two decimal places:\n1472670993.01\n1472670993.012345\n\nAdditionally they were also loaded as a double from GetNV() instead of as\ntwo longs, and this opened up for comparison errors and meant that when\nplaying back buffers from private queries, the last query was always replayed\nif it had a certain timestamp, which it would half of the time. ;)\n\nThis addresses issue #6\n","created_at":"2016-08-31T23:43:44Z","updated_at":"2016-12-02T21:24:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d8fd6161b1d88ed5152a34aa6c9d7b6ca10fe3a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/7/commits","review_comments_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/7/comments","review_comment_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/issues/7/comments","statuses_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/statuses/af4cdff9fda5683a923744b065e53af34eb71d76","head":{"label":"blole:master","ref":"master","sha":"af4cdff9fda5683a923744b065e53af34eb71d76","user":{"login":"blole","id":651644,"avatar_url":"https://avatars.githubusercontent.com/u/651644?v=3","gravatar_id":"","url":"https://api.github.com/users/blole","html_url":"https://github.com/blole","followers_url":"https://api.github.com/users/blole/followers","following_url":"https://api.github.com/users/blole/following{/other_user}","gists_url":"https://api.github.com/users/blole/gists{/gist_id}","starred_url":"https://api.github.com/users/blole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blole/subscriptions","organizations_url":"https://api.github.com/users/blole/orgs","repos_url":"https://api.github.com/users/blole/repos","events_url":"https://api.github.com/users/blole/events{/privacy}","received_events_url":"https://api.github.com/users/blole/received_events","type":"User","site_admin":false},"repo":{"id":67065006,"name":"znc-clientbuffer","full_name":"blole/znc-clientbuffer","owner":{"login":"blole","id":651644,"avatar_url":"https://avatars.githubusercontent.com/u/651644?v=3","gravatar_id":"","url":"https://api.github.com/users/blole","html_url":"https://github.com/blole","followers_url":"https://api.github.com/users/blole/followers","following_url":"https://api.github.com/users/blole/following{/other_user}","gists_url":"https://api.github.com/users/blole/gists{/gist_id}","starred_url":"https://api.github.com/users/blole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blole/subscriptions","organizations_url":"https://api.github.com/users/blole/orgs","repos_url":"https://api.github.com/users/blole/repos","events_url":"https://api.github.com/users/blole/events{/privacy}","received_events_url":"https://api.github.com/users/blole/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blole/znc-clientbuffer","description":"ZNC module for client specific buffers","fork":true,"url":"https://api.github.com/repos/blole/znc-clientbuffer","forks_url":"https://api.github.com/repos/blole/znc-clientbuffer/forks","keys_url":"https://api.github.com/repos/blole/znc-clientbuffer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blole/znc-clientbuffer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blole/znc-clientbuffer/teams","hooks_url":"https://api.github.com/repos/blole/znc-clientbuffer/hooks","issue_events_url":"https://api.github.com/repos/blole/znc-clientbuffer/issues/events{/number}","events_url":"https://api.github.com/repos/blole/znc-clientbuffer/events","assignees_url":"https://api.github.com/repos/blole/znc-clientbuffer/assignees{/user}","branches_url":"https://api.github.com/repos/blole/znc-clientbuffer/branches{/branch}","tags_url":"https://api.github.com/repos/blole/znc-clientbuffer/tags","blobs_url":"https://api.github.com/repos/blole/znc-clientbuffer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blole/znc-clientbuffer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blole/znc-clientbuffer/git/refs{/sha}","trees_url":"https://api.github.com/repos/blole/znc-clientbuffer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blole/znc-clientbuffer/statuses/{sha}","languages_url":"https://api.github.com/repos/blole/znc-clientbuffer/languages","stargazers_url":"https://api.github.com/repos/blole/znc-clientbuffer/stargazers","contributors_url":"https://api.github.com/repos/blole/znc-clientbuffer/contributors","subscribers_url":"https://api.github.com/repos/blole/znc-clientbuffer/subscribers","subscription_url":"https://api.github.com/repos/blole/znc-clientbuffer/subscription","commits_url":"https://api.github.com/repos/blole/znc-clientbuffer/commits{/sha}","git_commits_url":"https://api.github.com/repos/blole/znc-clientbuffer/git/commits{/sha}","comments_url":"https://api.github.com/repos/blole/znc-clientbuffer/comments{/number}","issue_comment_url":"https://api.github.com/repos/blole/znc-clientbuffer/issues/comments{/number}","contents_url":"https://api.github.com/repos/blole/znc-clientbuffer/contents/{+path}","compare_url":"https://api.github.com/repos/blole/znc-clientbuffer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blole/znc-clientbuffer/merges","archive_url":"https://api.github.com/repos/blole/znc-clientbuffer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blole/znc-clientbuffer/downloads","issues_url":"https://api.github.com/repos/blole/znc-clientbuffer/issues{/number}","pulls_url":"https://api.github.com/repos/blole/znc-clientbuffer/pulls{/number}","milestones_url":"https://api.github.com/repos/blole/znc-clientbuffer/milestones{/number}","notifications_url":"https://api.github.com/repos/blole/znc-clientbuffer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blole/znc-clientbuffer/labels{/name}","releases_url":"https://api.github.com/repos/blole/znc-clientbuffer/releases{/id}","deployments_url":"https://api.github.com/repos/blole/znc-clientbuffer/deployments","created_at":"2016-08-31T18:57:29Z","updated_at":"2016-08-31T18:57:30Z","pushed_at":"2016-08-31T23:36:24Z","git_url":"git://github.com/blole/znc-clientbuffer.git","ssh_url":"git@github.com:blole/znc-clientbuffer.git","clone_url":"https://github.com/blole/znc-clientbuffer.git","svn_url":"https://github.com/blole/znc-clientbuffer","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"jpnurmi:master","ref":"master","sha":"fe0f368e1fcab2b89d5c94209822d9b616cea840","user":{"login":"jpnurmi","id":140617,"avatar_url":"https://avatars.githubusercontent.com/u/140617?v=3","gravatar_id":"","url":"https://api.github.com/users/jpnurmi","html_url":"https://github.com/jpnurmi","followers_url":"https://api.github.com/users/jpnurmi/followers","following_url":"https://api.github.com/users/jpnurmi/following{/other_user}","gists_url":"https://api.github.com/users/jpnurmi/gists{/gist_id}","starred_url":"https://api.github.com/users/jpnurmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpnurmi/subscriptions","organizations_url":"https://api.github.com/users/jpnurmi/orgs","repos_url":"https://api.github.com/users/jpnurmi/repos","events_url":"https://api.github.com/users/jpnurmi/events{/privacy}","received_events_url":"https://api.github.com/users/jpnurmi/received_events","type":"User","site_admin":false},"repo":{"id":26558603,"name":"znc-clientbuffer","full_name":"jpnurmi/znc-clientbuffer","owner":{"login":"jpnurmi","id":140617,"avatar_url":"https://avatars.githubusercontent.com/u/140617?v=3","gravatar_id":"","url":"https://api.github.com/users/jpnurmi","html_url":"https://github.com/jpnurmi","followers_url":"https://api.github.com/users/jpnurmi/followers","following_url":"https://api.github.com/users/jpnurmi/following{/other_user}","gists_url":"https://api.github.com/users/jpnurmi/gists{/gist_id}","starred_url":"https://api.github.com/users/jpnurmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpnurmi/subscriptions","organizations_url":"https://api.github.com/users/jpnurmi/orgs","repos_url":"https://api.github.com/users/jpnurmi/repos","events_url":"https://api.github.com/users/jpnurmi/events{/privacy}","received_events_url":"https://api.github.com/users/jpnurmi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpnurmi/znc-clientbuffer","description":"ZNC module for client specific buffers","fork":false,"url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer","forks_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/forks","keys_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/teams","hooks_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/hooks","issue_events_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/issues/events{/number}","events_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/events","assignees_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/assignees{/user}","branches_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/branches{/branch}","tags_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/tags","blobs_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/statuses/{sha}","languages_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/languages","stargazers_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/stargazers","contributors_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/contributors","subscribers_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/subscribers","subscription_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/subscription","commits_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/contents/{+path}","compare_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/merges","archive_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/downloads","issues_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/issues{/number}","pulls_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls{/number}","milestones_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/milestones{/number}","notifications_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/labels{/name}","releases_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/releases{/id}","deployments_url":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/deployments","created_at":"2014-11-12T22:10:24Z","updated_at":"2016-11-20T22:18:34Z","pushed_at":"2016-08-31T23:43:44Z","git_url":"git://github.com/jpnurmi/znc-clientbuffer.git","ssh_url":"git@github.com:jpnurmi/znc-clientbuffer.git","clone_url":"https://github.com/jpnurmi/znc-clientbuffer.git","svn_url":"https://github.com/jpnurmi/znc-clientbuffer","homepage":null,"size":218,"stargazers_count":15,"watchers_count":15,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":7,"forks":6,"open_issues":7,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/7"},"html":{"href":"https://github.com/jpnurmi/znc-clientbuffer/pull/7"},"issue":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/issues/7"},"comments":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/jpnurmi/znc-clientbuffer/statuses/af4cdff9fda5683a923744b065e53af34eb71d76"}}}}
{"actor":{"display_login":"CyberShadow"}}