{"action":"created","comment":{"url":"https://api.github.com/repos/wireapp/wire-ios/pulls/comments/92774131","pull_request_review_id":13294590,"id":92774131,"diff_hunk":"@@ -0,0 +1,242 @@\n+//\n+// Wire\n+// Copyright (C) 2016 Wire Swiss GmbH\n+//\n+// This program is free software: you can redistribute it and/or modify\n+// it under the terms of the GNU General Public License as published by\n+// the Free Software Foundation, either version 3 of the License, or\n+// (at your option) any later version.\n+//\n+// This program is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+// GNU General Public License for more 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+\n+\n+import Foundation\n+\n+\n+final public class CollectionsViewController: UIViewController {\n+    public let conversation: ZMConversation\n+    public var onDismiss: ((CollectionsViewController)->())?\n+    public var analyticsTracker: AnalyticsTracker?\n+    \n+    private let collectionsView = CollectionsView()\n+    fileprivate let messagePresenter = MessagePresenter()\n+    \n+    fileprivate var imageMessages: [ZMConversationMessage] = []\n+    fileprivate var videoMessages: [ZMConversationMessage] = []\n+    fileprivate var fileAndAudioMessages: [ZMConversationMessage] = []\n+    \n+    init(conversation: ZMConversation) {\n+        self.conversation = conversation\n+        super.init(nibName: .none, bundle: .none)\n+        \n+        self.imageMessages = self.conversation.messages.filter {\n+            if let message = $0 as? ZMConversationMessage, let _ = message.imageMessageData\n+            { return true }\n+            else\n+            { return false }\n+        } as! [ZMConversationMessage]\n+        \n+        self.videoMessages = self.conversation.messages.filter {\n+            if let message = $0 as? ZMConversationMessage, let fileMessageData = message.fileMessageData, fileMessageData.isVideo()\n+            { return true }\n+            else\n+            { return false }\n+        } as! [ZMConversationMessage]\n+        \n+        self.fileAndAudioMessages = self.conversation.messages.filter {\n+            if let message = $0 as? ZMConversationMessage, let fileMessageData = message.fileMessageData, !fileMessageData.isVideo()\n+            { return true }\n+            else\n+            { return false }\n+            } as! [ZMConversationMessage]\n+    }\n+    \n+    required public init?(coder aDecoder: NSCoder) {\n+        fatalError(\"init(coder:) has not been implemented\")\n+    }\n+    \n+    override public func loadView() {\n+        self.messagePresenter.targetViewController = self\n+        self.messagePresenter.modalTargetController = self\n+        self.messagePresenter.analyticsTracker = self.analyticsTracker\n+        \n+        self.view = self.collectionsView\n+        \n+        self.collectionsView.collectionView.delegate = self\n+        self.collectionsView.collectionView.dataSource = self\n+        self.navigationItem.titleView = ConversationTitleView(conversation: self.conversation)\n+        \n+        \n+        let button = IconButton.iconButtonDefault()","path":"Wire-iOS/Sources/UserInterface/Collections/CollectionsViewController.swift","position":77,"original_position":77,"commit_id":"7f571e042b4344bdac64b652ef4dd1a7767ae816","original_commit_id":"7f571e042b4344bdac64b652ef4dd1a7767ae816","user":{"login":"daehn","id":4603353,"avatar_url":"https://avatars.githubusercontent.com/u/4603353?v=3","gravatar_id":"","url":"https://api.github.com/users/daehn","html_url":"https://github.com/daehn","followers_url":"https://api.github.com/users/daehn/followers","following_url":"https://api.github.com/users/daehn/following{/other_user}","gists_url":"https://api.github.com/users/daehn/gists{/gist_id}","starred_url":"https://api.github.com/users/daehn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daehn/subscriptions","organizations_url":"https://api.github.com/users/daehn/orgs","repos_url":"https://api.github.com/users/daehn/repos","events_url":"https://api.github.com/users/daehn/events{/privacy}","received_events_url":"https://api.github.com/users/daehn/received_events","type":"User","site_admin":false},"body":"I think it would make sense to move the calls unrelated to loading the view from `loadView` into `init` or `viewDidLoad`","created_at":"2016-12-16T09:01:54Z","updated_at":"2016-12-16T09:08:32Z","html_url":"https://github.com/wireapp/wire-ios/pull/489#discussion_r92774131","pull_request_url":"https://api.github.com/repos/wireapp/wire-ios/pulls/489","_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-ios/pulls/comments/92774131"},"html":{"href":"https://github.com/wireapp/wire-ios/pull/489#discussion_r92774131"},"pull_request":{"href":"https://api.github.com/repos/wireapp/wire-ios/pulls/489"}}},"pull_request":{"url":"https://api.github.com/repos/wireapp/wire-ios/pulls/489","id":98196431,"html_url":"https://github.com/wireapp/wire-ios/pull/489","diff_url":"https://github.com/wireapp/wire-ios/pull/489.diff","patch_url":"https://github.com/wireapp/wire-ios/pull/489.patch","issue_url":"https://api.github.com/repos/wireapp/wire-ios/issues/489","number":489,"state":"open","locked":false,"title":"View content of file transfers","user":{"login":"mikeger","id":715129,"avatar_url":"https://avatars.githubusercontent.com/u/715129?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeger","html_url":"https://github.com/mikeger","followers_url":"https://api.github.com/users/mikeger/followers","following_url":"https://api.github.com/users/mikeger/following{/other_user}","gists_url":"https://api.github.com/users/mikeger/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeger/subscriptions","organizations_url":"https://api.github.com/users/mikeger/orgs","repos_url":"https://api.github.com/users/mikeger/repos","events_url":"https://api.github.com/users/mikeger/events{/privacy}","received_events_url":"https://api.github.com/users/mikeger/received_events","type":"User","site_admin":false},"body":"# What's new\r\n\r\n- Refactored conversation content cells to views in order to reuse them in the collection view\r\n- Refactored the way we open files into `MessagePresenter`\r\n- Added file transfer sections to `CollectionsViewController`","created_at":"2016-12-15T17:35:58Z","updated_at":"2016-12-16T09:08:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"088e6f55475cc36b34b7c81ecedc7ba76deb7602","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/wireapp/wire-ios/milestones/13","html_url":"https://github.com/wireapp/wire-ios/milestone/13","labels_url":"https://api.github.com/repos/wireapp/wire-ios/milestones/13/labels","id":2163267,"number":13,"title":"2.25 Collections 🌈","description":"","creator":{"login":"mikeger","id":715129,"avatar_url":"https://avatars.githubusercontent.com/u/715129?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeger","html_url":"https://github.com/mikeger","followers_url":"https://api.github.com/users/mikeger/followers","following_url":"https://api.github.com/users/mikeger/following{/other_user}","gists_url":"https://api.github.com/users/mikeger/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeger/subscriptions","organizations_url":"https://api.github.com/users/mikeger/orgs","repos_url":"https://api.github.com/users/mikeger/repos","events_url":"https://api.github.com/users/mikeger/events{/privacy}","received_events_url":"https://api.github.com/users/mikeger/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":1,"state":"open","created_at":"2016-11-29T09:57:24Z","updated_at":"2016-12-15T17:35:58Z","due_on":"2016-12-23T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/wireapp/wire-ios/pulls/489/commits","review_comments_url":"https://api.github.com/repos/wireapp/wire-ios/pulls/489/comments","review_comment_url":"https://api.github.com/repos/wireapp/wire-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wireapp/wire-ios/issues/489/comments","statuses_url":"https://api.github.com/repos/wireapp/wire-ios/statuses/7f571e042b4344bdac64b652ef4dd1a7767ae816","head":{"label":"wireapp:feature/collections-view","ref":"feature/collections-view","sha":"7f571e042b4344bdac64b652ef4dd1a7767ae816","user":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars.githubusercontent.com/u/16047324?v=3","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":63855049,"name":"wire-ios","full_name":"wireapp/wire-ios","owner":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars.githubusercontent.com/u/16047324?v=3","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-ios","description":"📱 Wire iOS client (iPhone and iPad)","fork":false,"url":"https://api.github.com/repos/wireapp/wire-ios","forks_url":"https://api.github.com/repos/wireapp/wire-ios/forks","keys_url":"https://api.github.com/repos/wireapp/wire-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-ios/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-ios/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-ios/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-ios/events","assignees_url":"https://api.github.com/repos/wireapp/wire-ios/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-ios/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-ios/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-ios/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-ios/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-ios/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-ios/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-ios/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-ios/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-ios/merges","archive_url":"https://api.github.com/repos/wireapp/wire-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-ios/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-ios/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-ios/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-ios/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-ios/deployments","created_at":"2016-07-21T09:16:34Z","updated_at":"2016-12-16T08:53:45Z","pushed_at":"2016-12-15T17:35:58Z","git_url":"git://github.com/wireapp/wire-ios.git","ssh_url":"git@github.com:wireapp/wire-ios.git","clone_url":"https://github.com/wireapp/wire-ios.git","svn_url":"https://github.com/wireapp/wire-ios","homepage":"https://wire.com/download/","size":79405,"stargazers_count":1690,"watchers_count":1690,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":245,"mirror_url":null,"open_issues_count":63,"forks":245,"open_issues":63,"watchers":1690,"default_branch":"develop"}},"base":{"label":"wireapp:feature/collections","ref":"feature/collections","sha":"17b2900194d8329ff6c9805dce2dd208aa3a4179","user":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars.githubusercontent.com/u/16047324?v=3","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":63855049,"name":"wire-ios","full_name":"wireapp/wire-ios","owner":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars.githubusercontent.com/u/16047324?v=3","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-ios","description":"📱 Wire iOS client (iPhone and iPad)","fork":false,"url":"https://api.github.com/repos/wireapp/wire-ios","forks_url":"https://api.github.com/repos/wireapp/wire-ios/forks","keys_url":"https://api.github.com/repos/wireapp/wire-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-ios/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-ios/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-ios/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-ios/events","assignees_url":"https://api.github.com/repos/wireapp/wire-ios/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-ios/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-ios/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-ios/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-ios/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-ios/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-ios/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-ios/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-ios/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-ios/merges","archive_url":"https://api.github.com/repos/wireapp/wire-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-ios/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-ios/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-ios/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-ios/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-ios/deployments","created_at":"2016-07-21T09:16:34Z","updated_at":"2016-12-16T08:53:45Z","pushed_at":"2016-12-15T17:35:58Z","git_url":"git://github.com/wireapp/wire-ios.git","ssh_url":"git@github.com:wireapp/wire-ios.git","clone_url":"https://github.com/wireapp/wire-ios.git","svn_url":"https://github.com/wireapp/wire-ios","homepage":"https://wire.com/download/","size":79405,"stargazers_count":1690,"watchers_count":1690,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":245,"mirror_url":null,"open_issues_count":63,"forks":245,"open_issues":63,"watchers":1690,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-ios/pulls/489"},"html":{"href":"https://github.com/wireapp/wire-ios/pull/489"},"issue":{"href":"https://api.github.com/repos/wireapp/wire-ios/issues/489"},"comments":{"href":"https://api.github.com/repos/wireapp/wire-ios/issues/489/comments"},"review_comments":{"href":"https://api.github.com/repos/wireapp/wire-ios/pulls/489/comments"},"review_comment":{"href":"https://api.github.com/repos/wireapp/wire-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wireapp/wire-ios/pulls/489/commits"},"statuses":{"href":"https://api.github.com/repos/wireapp/wire-ios/statuses/7f571e042b4344bdac64b652ef4dd1a7767ae816"}}}}
{"actor":{"display_login":"daehn"}}