{"action":"created","comment":{"url":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/comments/186275675","pull_request_review_id":117828382,"id":186275675,"diff_hunk":"@@ -93,32 +93,56 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsIssue: Is\n                 }\n             } else if let unlabeled = node.asUnlabeledEvent,\n                 let date = unlabeled.createdAt.githubDate {\n-                let model = IssueLabeledModel(\n-                    id: unlabeled.fragments.nodeFields.id,\n-                    actor: unlabeled.actor?.login ?? Constants.Strings.unknown,\n-                    title: unlabeled.label.name,\n-                    color: unlabeled.label.color,\n-                    date: date,\n-                    type: .removed,\n-                    repoOwner: owner,\n-                    repoName: repo,\n-                    width: width\n-                )\n-                results.append(model)\n+                    let newDetails = IssueLabeledModel.LabelDetails(\n+                        id: unlabeled.fragments.nodeFields.id,\n+                        title: unlabeled.label.name,\n+                        color: unlabeled.label.color,\n+                        date: date,\n+                        type: .removed)\n+                    var removed = [IssueLabeledModel.LabelDetails]()\n+                    var added = [IssueLabeledModel.LabelDetails]()\n+\n+                    if let lastModel = results.last as? IssueLabeledModel,\n+                        lastModel.actor == unlabeled.actor?.login {\n+                        added = lastModel.added\n+                        removed = lastModel.removed\n+                        removed.append(newDetails)\n+                        results.removeLast()\n+                    }\n+                    let newModel = IssueLabeledModel(\n+                        actor: unlabeled.actor?.login ?? Constants.Strings.unknown,\n+                        added: added,\n+                        removed: removed,\n+                        repoOwner: owner,\n+                        repoName: repo,\n+                        width: width)\n+                    results.append(newModel)\n             } else if let labeled = node.asLabeledEvent,\n                 let date = labeled.createdAt.githubDate {\n-                let model = IssueLabeledModel(\n-                    id: labeled.fragments.nodeFields.id,\n-                    actor: labeled.actor?.login ?? Constants.Strings.unknown,\n-                    title: labeled.label.name,\n-                    color: labeled.label.color,\n-                    date: date,\n-                    type: .added,\n-                    repoOwner: owner,\n-                    repoName: repo,\n-                    width: width\n-                )\n-                results.append(model)\n+                    let newDetails = IssueLabeledModel.LabelDetails(\n+                        id: labeled.fragments.nodeFields.id,\n+                        title: labeled.label.name,\n+                        color: labeled.label.color,\n+                        date: date,\n+                        type: .added)\n+                    var removed = [IssueLabeledModel.LabelDetails]()\n+                    var added = [IssueLabeledModel.LabelDetails]()\n+\n+                    if let lastModel = results.last as? IssueLabeledModel,\n+                        lastModel.actor == labeled.actor?.login {\n+                        added = lastModel.added\n+                        removed = lastModel.removed\n+                        removed.append(newDetails)","path":"Classes/Issues/Issue+IssueType.swift","position":null,"original_position":67,"commit_id":"359e4b12292c2f1ac39761fff7a572e0f52122ca","original_commit_id":"4a87af557e51cfb3e96e0c2061d4dc8d6792b728","user":{"login":"rnystrom","id":739696,"avatar_url":"https://avatars2.githubusercontent.com/u/739696?v=4","gravatar_id":"","url":"https://api.github.com/users/rnystrom","html_url":"https://github.com/rnystrom","followers_url":"https://api.github.com/users/rnystrom/followers","following_url":"https://api.github.com/users/rnystrom/following{/other_user}","gists_url":"https://api.github.com/users/rnystrom/gists{/gist_id}","starred_url":"https://api.github.com/users/rnystrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnystrom/subscriptions","organizations_url":"https://api.github.com/users/rnystrom/orgs","repos_url":"https://api.github.com/users/rnystrom/repos","events_url":"https://api.github.com/users/rnystrom/events{/privacy}","received_events_url":"https://api.github.com/users/rnystrom/received_events","type":"User","site_admin":false},"body":"test","created_at":"2018-05-06T00:37:31Z","updated_at":"2018-05-06T00:37:31Z","html_url":"https://github.com/GitHawkApp/GitHawk/pull/1567#discussion_r186275675","pull_request_url":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/1567","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/comments/186275675"},"html":{"href":"https://github.com/GitHawkApp/GitHawk/pull/1567#discussion_r186275675"},"pull_request":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/1567"}},"in_reply_to_id":169889920},"pull_request":{"url":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/1567","id":170687417,"html_url":"https://github.com/GitHawkApp/GitHawk/pull/1567","diff_url":"https://github.com/GitHawkApp/GitHawk/pull/1567.diff","patch_url":"https://github.com/GitHawkApp/GitHawk/pull/1567.patch","issue_url":"https://api.github.com/repos/GitHawkApp/GitHawk/issues/1567","number":1567,"state":"open","locked":false,"title":"[WIP] Combine label added and removed events","user":{"login":"SD10","id":7445580,"avatar_url":"https://avatars0.githubusercontent.com/u/7445580?v=4","gravatar_id":"","url":"https://api.github.com/users/SD10","html_url":"https://github.com/SD10","followers_url":"https://api.github.com/users/SD10/followers","following_url":"https://api.github.com/users/SD10/following{/other_user}","gists_url":"https://api.github.com/users/SD10/gists{/gist_id}","starred_url":"https://api.github.com/users/SD10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SD10/subscriptions","organizations_url":"https://api.github.com/users/SD10/orgs","repos_url":"https://api.github.com/users/SD10/repos","events_url":"https://api.github.com/users/SD10/events{/privacy}","received_events_url":"https://api.github.com/users/SD10/received_events","type":"User","site_admin":false},"body":"Resolves #1321 \r\n\r\n~**This is extremely bug ridden**. The events, UI, and everything is inaccurate.~\r\nGetting better but needs refinement.\r\nJust showing some of the complexity involved. This is the first time I could get the project to build 😓\r\n\r\n### GitHawk:\r\n<img width=\"331\" alt=\"screen shot 2018-02-22 at 3 12 34 am\" src=\"https://user-images.githubusercontent.com/7445580/36529598-68e89ca6-177e-11e8-9a51-1c441836c924.png\">\r\n\r\n### GitHub:\r\n<img width=\"774\" alt=\"screen shot 2018-02-22 at 3 14 51 am\" src=\"https://user-images.githubusercontent.com/7445580/36529674-a4564568-177e-11e8-8e51-6aaf6e3c19d9.png\">\r\n\r\n\r\n","created_at":"2018-02-22T08:46:13Z","updated_at":"2018-05-06T00:37:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"702ba54ddf89050218d094f94ddef59adcd65df7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/1567/commits","review_comments_url":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/1567/comments","review_comment_url":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GitHawkApp/GitHawk/issues/1567/comments","statuses_url":"https://api.github.com/repos/GitHawkApp/GitHawk/statuses/359e4b12292c2f1ac39761fff7a572e0f52122ca","head":{"label":"GitHawkApp:enhancement/combine-labels","ref":"enhancement/combine-labels","sha":"359e4b12292c2f1ac39761fff7a572e0f52122ca","user":{"login":"GitHawkApp","id":32285710,"avatar_url":"https://avatars3.githubusercontent.com/u/32285710?v=4","gravatar_id":"","url":"https://api.github.com/users/GitHawkApp","html_url":"https://github.com/GitHawkApp","followers_url":"https://api.github.com/users/GitHawkApp/followers","following_url":"https://api.github.com/users/GitHawkApp/following{/other_user}","gists_url":"https://api.github.com/users/GitHawkApp/gists{/gist_id}","starred_url":"https://api.github.com/users/GitHawkApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitHawkApp/subscriptions","organizations_url":"https://api.github.com/users/GitHawkApp/orgs","repos_url":"https://api.github.com/users/GitHawkApp/repos","events_url":"https://api.github.com/users/GitHawkApp/events{/privacy}","received_events_url":"https://api.github.com/users/GitHawkApp/received_events","type":"Organization","site_admin":false},"repo":{"id":89921801,"name":"GitHawk","full_name":"GitHawkApp/GitHawk","owner":{"login":"GitHawkApp","id":32285710,"avatar_url":"https://avatars3.githubusercontent.com/u/32285710?v=4","gravatar_id":"","url":"https://api.github.com/users/GitHawkApp","html_url":"https://github.com/GitHawkApp","followers_url":"https://api.github.com/users/GitHawkApp/followers","following_url":"https://api.github.com/users/GitHawkApp/following{/other_user}","gists_url":"https://api.github.com/users/GitHawkApp/gists{/gist_id}","starred_url":"https://api.github.com/users/GitHawkApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitHawkApp/subscriptions","organizations_url":"https://api.github.com/users/GitHawkApp/orgs","repos_url":"https://api.github.com/users/GitHawkApp/repos","events_url":"https://api.github.com/users/GitHawkApp/events{/privacy}","received_events_url":"https://api.github.com/users/GitHawkApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GitHawkApp/GitHawk","description":"A GitHub project manager app for iOS.","fork":false,"url":"https://api.github.com/repos/GitHawkApp/GitHawk","forks_url":"https://api.github.com/repos/GitHawkApp/GitHawk/forks","keys_url":"https://api.github.com/repos/GitHawkApp/GitHawk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GitHawkApp/GitHawk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GitHawkApp/GitHawk/teams","hooks_url":"https://api.github.com/repos/GitHawkApp/GitHawk/hooks","issue_events_url":"https://api.github.com/repos/GitHawkApp/GitHawk/issues/events{/number}","events_url":"https://api.github.com/repos/GitHawkApp/GitHawk/events","assignees_url":"https://api.github.com/repos/GitHawkApp/GitHawk/assignees{/user}","branches_url":"https://api.github.com/repos/GitHawkApp/GitHawk/branches{/branch}","tags_url":"https://api.github.com/repos/GitHawkApp/GitHawk/tags","blobs_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/refs{/sha}","trees_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GitHawkApp/GitHawk/statuses/{sha}","languages_url":"https://api.github.com/repos/GitHawkApp/GitHawk/languages","stargazers_url":"https://api.github.com/repos/GitHawkApp/GitHawk/stargazers","contributors_url":"https://api.github.com/repos/GitHawkApp/GitHawk/contributors","subscribers_url":"https://api.github.com/repos/GitHawkApp/GitHawk/subscribers","subscription_url":"https://api.github.com/repos/GitHawkApp/GitHawk/subscription","commits_url":"https://api.github.com/repos/GitHawkApp/GitHawk/commits{/sha}","git_commits_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/commits{/sha}","comments_url":"https://api.github.com/repos/GitHawkApp/GitHawk/comments{/number}","issue_comment_url":"https://api.github.com/repos/GitHawkApp/GitHawk/issues/comments{/number}","contents_url":"https://api.github.com/repos/GitHawkApp/GitHawk/contents/{+path}","compare_url":"https://api.github.com/repos/GitHawkApp/GitHawk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GitHawkApp/GitHawk/merges","archive_url":"https://api.github.com/repos/GitHawkApp/GitHawk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GitHawkApp/GitHawk/downloads","issues_url":"https://api.github.com/repos/GitHawkApp/GitHawk/issues{/number}","pulls_url":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls{/number}","milestones_url":"https://api.github.com/repos/GitHawkApp/GitHawk/milestones{/number}","notifications_url":"https://api.github.com/repos/GitHawkApp/GitHawk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GitHawkApp/GitHawk/labels{/name}","releases_url":"https://api.github.com/repos/GitHawkApp/GitHawk/releases{/id}","deployments_url":"https://api.github.com/repos/GitHawkApp/GitHawk/deployments","created_at":"2017-05-01T12:21:48Z","updated_at":"2018-05-05T19:29:53Z","pushed_at":"2018-05-05T16:04:24Z","git_url":"git://github.com/GitHawkApp/GitHawk.git","ssh_url":"git@github.com:GitHawkApp/GitHawk.git","clone_url":"https://github.com/GitHawkApp/GitHawk.git","svn_url":"https://github.com/GitHawkApp/GitHawk","homepage":"http://githawk.com","size":125511,"stargazers_count":961,"watchers_count":961,"language":"Swift","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":105,"mirror_url":null,"archived":false,"open_issues_count":317,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":105,"open_issues":317,"watchers":961,"default_branch":"master"}},"base":{"label":"GitHawkApp:master","ref":"master","sha":"803f9e29c55404d32423c7777f111785e308574c","user":{"login":"GitHawkApp","id":32285710,"avatar_url":"https://avatars3.githubusercontent.com/u/32285710?v=4","gravatar_id":"","url":"https://api.github.com/users/GitHawkApp","html_url":"https://github.com/GitHawkApp","followers_url":"https://api.github.com/users/GitHawkApp/followers","following_url":"https://api.github.com/users/GitHawkApp/following{/other_user}","gists_url":"https://api.github.com/users/GitHawkApp/gists{/gist_id}","starred_url":"https://api.github.com/users/GitHawkApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitHawkApp/subscriptions","organizations_url":"https://api.github.com/users/GitHawkApp/orgs","repos_url":"https://api.github.com/users/GitHawkApp/repos","events_url":"https://api.github.com/users/GitHawkApp/events{/privacy}","received_events_url":"https://api.github.com/users/GitHawkApp/received_events","type":"Organization","site_admin":false},"repo":{"id":89921801,"name":"GitHawk","full_name":"GitHawkApp/GitHawk","owner":{"login":"GitHawkApp","id":32285710,"avatar_url":"https://avatars3.githubusercontent.com/u/32285710?v=4","gravatar_id":"","url":"https://api.github.com/users/GitHawkApp","html_url":"https://github.com/GitHawkApp","followers_url":"https://api.github.com/users/GitHawkApp/followers","following_url":"https://api.github.com/users/GitHawkApp/following{/other_user}","gists_url":"https://api.github.com/users/GitHawkApp/gists{/gist_id}","starred_url":"https://api.github.com/users/GitHawkApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitHawkApp/subscriptions","organizations_url":"https://api.github.com/users/GitHawkApp/orgs","repos_url":"https://api.github.com/users/GitHawkApp/repos","events_url":"https://api.github.com/users/GitHawkApp/events{/privacy}","received_events_url":"https://api.github.com/users/GitHawkApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GitHawkApp/GitHawk","description":"A GitHub project manager app for iOS.","fork":false,"url":"https://api.github.com/repos/GitHawkApp/GitHawk","forks_url":"https://api.github.com/repos/GitHawkApp/GitHawk/forks","keys_url":"https://api.github.com/repos/GitHawkApp/GitHawk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GitHawkApp/GitHawk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GitHawkApp/GitHawk/teams","hooks_url":"https://api.github.com/repos/GitHawkApp/GitHawk/hooks","issue_events_url":"https://api.github.com/repos/GitHawkApp/GitHawk/issues/events{/number}","events_url":"https://api.github.com/repos/GitHawkApp/GitHawk/events","assignees_url":"https://api.github.com/repos/GitHawkApp/GitHawk/assignees{/user}","branches_url":"https://api.github.com/repos/GitHawkApp/GitHawk/branches{/branch}","tags_url":"https://api.github.com/repos/GitHawkApp/GitHawk/tags","blobs_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/refs{/sha}","trees_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GitHawkApp/GitHawk/statuses/{sha}","languages_url":"https://api.github.com/repos/GitHawkApp/GitHawk/languages","stargazers_url":"https://api.github.com/repos/GitHawkApp/GitHawk/stargazers","contributors_url":"https://api.github.com/repos/GitHawkApp/GitHawk/contributors","subscribers_url":"https://api.github.com/repos/GitHawkApp/GitHawk/subscribers","subscription_url":"https://api.github.com/repos/GitHawkApp/GitHawk/subscription","commits_url":"https://api.github.com/repos/GitHawkApp/GitHawk/commits{/sha}","git_commits_url":"https://api.github.com/repos/GitHawkApp/GitHawk/git/commits{/sha}","comments_url":"https://api.github.com/repos/GitHawkApp/GitHawk/comments{/number}","issue_comment_url":"https://api.github.com/repos/GitHawkApp/GitHawk/issues/comments{/number}","contents_url":"https://api.github.com/repos/GitHawkApp/GitHawk/contents/{+path}","compare_url":"https://api.github.com/repos/GitHawkApp/GitHawk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GitHawkApp/GitHawk/merges","archive_url":"https://api.github.com/repos/GitHawkApp/GitHawk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GitHawkApp/GitHawk/downloads","issues_url":"https://api.github.com/repos/GitHawkApp/GitHawk/issues{/number}","pulls_url":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls{/number}","milestones_url":"https://api.github.com/repos/GitHawkApp/GitHawk/milestones{/number}","notifications_url":"https://api.github.com/repos/GitHawkApp/GitHawk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GitHawkApp/GitHawk/labels{/name}","releases_url":"https://api.github.com/repos/GitHawkApp/GitHawk/releases{/id}","deployments_url":"https://api.github.com/repos/GitHawkApp/GitHawk/deployments","created_at":"2017-05-01T12:21:48Z","updated_at":"2018-05-05T19:29:53Z","pushed_at":"2018-05-05T16:04:24Z","git_url":"git://github.com/GitHawkApp/GitHawk.git","ssh_url":"git@github.com:GitHawkApp/GitHawk.git","clone_url":"https://github.com/GitHawkApp/GitHawk.git","svn_url":"https://github.com/GitHawkApp/GitHawk","homepage":"http://githawk.com","size":125511,"stargazers_count":961,"watchers_count":961,"language":"Swift","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":105,"mirror_url":null,"archived":false,"open_issues_count":317,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":105,"open_issues":317,"watchers":961,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/1567"},"html":{"href":"https://github.com/GitHawkApp/GitHawk/pull/1567"},"issue":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/issues/1567"},"comments":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/issues/1567/comments"},"review_comments":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/1567/comments"},"review_comment":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/pulls/1567/commits"},"statuses":{"href":"https://api.github.com/repos/GitHawkApp/GitHawk/statuses/359e4b12292c2f1ac39761fff7a572e0f52122ca"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"rnystrom"}}