{"action":"created","comment":{"url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/comments/33820274","id":33820274,"diff_hunk":"@@ -0,0 +1,82 @@\n+//\n+//  AbstractCallViewController.m\n+//  Antidote\n+//\n+//  Created by Chuong Vu on 7/2/15.\n+//  Copyright (c) 2015 dvor. All rights reserved.\n+//\n+\n+#import \"AbstractCallViewController.h\"\n+\n+#import \"Masonry.h\"\n+#import \"Helper.h\"\n+#import \"OCTCall.h\"\n+#import \"OCTChat.h\"\n+#import \"OCTSubmanagerCalls.h\"\n+\n+@interface AbstractCallViewController () <RBQFetchedResultsControllerDelegate>\n+\n+@property (strong, nonatomic) RBQFetchedResultsController *callController;\n+\n+@end\n+\n+@implementation AbstractCallViewController\n+\n+#pragma mark - Life cycle\n+\n+- (instancetype)initWithChat:(OCTChat *)chat submanagerCalls:(OCTSubmanagerCalls *)manager\n+{\n+    self = [super init];\n+    if (! self) {\n+        return nil;\n+    }\n+\n+    NSPredicate *predicate = [NSPredicate predicateWithFormat:@\"chat == %@\", chat];\n+    _callController = [Helper createFetchedResultsControllerForType:OCTFetchRequestTypeCall predicate:predicate delegate:self];\n+    _callController.delegate = self;\n+\n+    _call = [[_callController fetchedObjects] firstObject];\n+\n+    if (! _call) {","path":"Antidote/AbstractCallViewController.m","position":40,"original_position":40,"commit_id":"af027ff8f34c3aeb0e7ad861e533482b28ba70da","original_commit_id":"af027ff8f34c3aeb0e7ad861e533482b28ba70da","user":{"login":"dvor","id":1132979,"avatar_url":"https://avatars.githubusercontent.com/u/1132979?v=3","gravatar_id":"","url":"https://api.github.com/users/dvor","html_url":"https://github.com/dvor","followers_url":"https://api.github.com/users/dvor/followers","following_url":"https://api.github.com/users/dvor/following{/other_user}","gists_url":"https://api.github.com/users/dvor/gists{/gist_id}","starred_url":"https://api.github.com/users/dvor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvor/subscriptions","organizations_url":"https://api.github.com/users/dvor/orgs","repos_url":"https://api.github.com/users/dvor/repos","events_url":"https://api.github.com/users/dvor/events{/privacy}","received_events_url":"https://api.github.com/users/dvor/received_events","type":"User","site_admin":false},"body":"Hm. Subclass can be responsible for creating/getting call.\r\n\r\nAlso Ringing controller will be created with existing call. It can just pass it to superclass. Pseudocode:\r\n\r\n```\r\n// Abstract controller\r\n- (instancetype)initWithCall:(OCTCall *)call submanagerCalls:...\r\n{\r\n   ...\r\n   _call = call;\r\n   // get call.chat.uniqueIdentifier and subsribe for updates\r\n}\r\n\r\n// Dialing controller\r\n- (instancetype)initWithChat:(OCTChat *)chat submanager...\r\n{\r\n    call = [submanager getCallFromChat:chat];\r\n    self = [super initWithCall:call submanager...\r\n...\r\n\r\n// Ringing controller\r\n- (instancetype)initWithCall:(OCTCall *)call submanagerCalls:...\r\n{\r\n    self = [super initWithCall:call submanager...\r\n...\r\n```","created_at":"2015-07-02T20:38:32Z","updated_at":"2015-07-02T20:38:32Z","html_url":"https://github.com/Antidote-for-Tox/Antidote/pull/31#discussion_r33820274","pull_request_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/comments/33820274"},"html":{"href":"https://github.com/Antidote-for-Tox/Antidote/pull/31#discussion_r33820274"},"pull_request":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/31","id":39054023,"html_url":"https://github.com/Antidote-for-Tox/Antidote/pull/31","diff_url":"https://github.com/Antidote-for-Tox/Antidote/pull/31.diff","patch_url":"https://github.com/Antidote-for-Tox/Antidote/pull/31.patch","issue_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues/31","number":31,"state":"open","locked":false,"title":"Start of audio implementation","user":{"login":"Chuongv","id":5170710,"avatar_url":"https://avatars.githubusercontent.com/u/5170710?v=3","gravatar_id":"","url":"https://api.github.com/users/Chuongv","html_url":"https://github.com/Chuongv","followers_url":"https://api.github.com/users/Chuongv/followers","following_url":"https://api.github.com/users/Chuongv/following{/other_user}","gists_url":"https://api.github.com/users/Chuongv/gists{/gist_id}","starred_url":"https://api.github.com/users/Chuongv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chuongv/subscriptions","organizations_url":"https://api.github.com/users/Chuongv/orgs","repos_url":"https://api.github.com/users/Chuongv/repos","events_url":"https://api.github.com/users/Chuongv/events{/privacy}","received_events_url":"https://api.github.com/users/Chuongv/received_events","type":"User","site_admin":false},"body":"Still a lot of work to do but some progress. Would like some comments or suggestions to make sure I am on the right path :smile: \r\n\r\n","created_at":"2015-07-02T07:12:52Z","updated_at":"2015-07-02T20:38:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6477674a9a606328736d2887c81a59b37d46c223","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/31/commits","review_comments_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/31/comments","review_comment_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues/31/comments","statuses_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/statuses/af027ff8f34c3aeb0e7ad861e533482b28ba70da","head":{"label":"Antidote-for-Tox:chuongv/audio","ref":"chuongv/audio","sha":"af027ff8f34c3aeb0e7ad861e533482b28ba70da","user":{"login":"Antidote-for-Tox","id":12895321,"avatar_url":"https://avatars.githubusercontent.com/u/12895321?v=3","gravatar_id":"","url":"https://api.github.com/users/Antidote-for-Tox","html_url":"https://github.com/Antidote-for-Tox","followers_url":"https://api.github.com/users/Antidote-for-Tox/followers","following_url":"https://api.github.com/users/Antidote-for-Tox/following{/other_user}","gists_url":"https://api.github.com/users/Antidote-for-Tox/gists{/gist_id}","starred_url":"https://api.github.com/users/Antidote-for-Tox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antidote-for-Tox/subscriptions","organizations_url":"https://api.github.com/users/Antidote-for-Tox/orgs","repos_url":"https://api.github.com/users/Antidote-for-Tox/repos","events_url":"https://api.github.com/users/Antidote-for-Tox/events{/privacy}","received_events_url":"https://api.github.com/users/Antidote-for-Tox/received_events","type":"Organization","site_admin":false},"repo":{"id":22009360,"name":"Antidote","full_name":"Antidote-for-Tox/Antidote","owner":{"login":"Antidote-for-Tox","id":12895321,"avatar_url":"https://avatars.githubusercontent.com/u/12895321?v=3","gravatar_id":"","url":"https://api.github.com/users/Antidote-for-Tox","html_url":"https://github.com/Antidote-for-Tox","followers_url":"https://api.github.com/users/Antidote-for-Tox/followers","following_url":"https://api.github.com/users/Antidote-for-Tox/following{/other_user}","gists_url":"https://api.github.com/users/Antidote-for-Tox/gists{/gist_id}","starred_url":"https://api.github.com/users/Antidote-for-Tox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antidote-for-Tox/subscriptions","organizations_url":"https://api.github.com/users/Antidote-for-Tox/orgs","repos_url":"https://api.github.com/users/Antidote-for-Tox/repos","events_url":"https://api.github.com/users/Antidote-for-Tox/events{/privacy}","received_events_url":"https://api.github.com/users/Antidote-for-Tox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Antidote-for-Tox/Antidote","description":"Tox client for iOS","fork":false,"url":"https://api.github.com/repos/Antidote-for-Tox/Antidote","forks_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/forks","keys_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/teams","hooks_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/hooks","issue_events_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues/events{/number}","events_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/events","assignees_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/assignees{/user}","branches_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/branches{/branch}","tags_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/tags","blobs_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/refs{/sha}","trees_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/statuses/{sha}","languages_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/languages","stargazers_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/stargazers","contributors_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/contributors","subscribers_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/subscribers","subscription_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/subscription","commits_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/commits{/sha}","git_commits_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/commits{/sha}","comments_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/comments{/number}","issue_comment_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues/comments{/number}","contents_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/contents/{+path}","compare_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/merges","archive_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/downloads","issues_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues{/number}","pulls_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls{/number}","milestones_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/milestones{/number}","notifications_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/labels{/name}","releases_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/releases{/id}","created_at":"2014-07-19T12:35:35Z","updated_at":"2015-06-24T10:24:19Z","pushed_at":"2015-07-02T18:54:02Z","git_url":"git://github.com/Antidote-for-Tox/Antidote.git","ssh_url":"git@github.com:Antidote-for-Tox/Antidote.git","clone_url":"https://github.com/Antidote-for-Tox/Antidote.git","svn_url":"https://github.com/Antidote-for-Tox/Antidote","homepage":null,"size":32755,"stargazers_count":102,"watchers_count":102,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":10,"forks":26,"open_issues":10,"watchers":102,"default_branch":"master"}},"base":{"label":"Antidote-for-Tox:audio","ref":"audio","sha":"178367119ab885274a1d007a2e1bf07c11cb80ec","user":{"login":"Antidote-for-Tox","id":12895321,"avatar_url":"https://avatars.githubusercontent.com/u/12895321?v=3","gravatar_id":"","url":"https://api.github.com/users/Antidote-for-Tox","html_url":"https://github.com/Antidote-for-Tox","followers_url":"https://api.github.com/users/Antidote-for-Tox/followers","following_url":"https://api.github.com/users/Antidote-for-Tox/following{/other_user}","gists_url":"https://api.github.com/users/Antidote-for-Tox/gists{/gist_id}","starred_url":"https://api.github.com/users/Antidote-for-Tox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antidote-for-Tox/subscriptions","organizations_url":"https://api.github.com/users/Antidote-for-Tox/orgs","repos_url":"https://api.github.com/users/Antidote-for-Tox/repos","events_url":"https://api.github.com/users/Antidote-for-Tox/events{/privacy}","received_events_url":"https://api.github.com/users/Antidote-for-Tox/received_events","type":"Organization","site_admin":false},"repo":{"id":22009360,"name":"Antidote","full_name":"Antidote-for-Tox/Antidote","owner":{"login":"Antidote-for-Tox","id":12895321,"avatar_url":"https://avatars.githubusercontent.com/u/12895321?v=3","gravatar_id":"","url":"https://api.github.com/users/Antidote-for-Tox","html_url":"https://github.com/Antidote-for-Tox","followers_url":"https://api.github.com/users/Antidote-for-Tox/followers","following_url":"https://api.github.com/users/Antidote-for-Tox/following{/other_user}","gists_url":"https://api.github.com/users/Antidote-for-Tox/gists{/gist_id}","starred_url":"https://api.github.com/users/Antidote-for-Tox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antidote-for-Tox/subscriptions","organizations_url":"https://api.github.com/users/Antidote-for-Tox/orgs","repos_url":"https://api.github.com/users/Antidote-for-Tox/repos","events_url":"https://api.github.com/users/Antidote-for-Tox/events{/privacy}","received_events_url":"https://api.github.com/users/Antidote-for-Tox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Antidote-for-Tox/Antidote","description":"Tox client for iOS","fork":false,"url":"https://api.github.com/repos/Antidote-for-Tox/Antidote","forks_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/forks","keys_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/teams","hooks_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/hooks","issue_events_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues/events{/number}","events_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/events","assignees_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/assignees{/user}","branches_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/branches{/branch}","tags_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/tags","blobs_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/refs{/sha}","trees_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/statuses/{sha}","languages_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/languages","stargazers_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/stargazers","contributors_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/contributors","subscribers_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/subscribers","subscription_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/subscription","commits_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/commits{/sha}","git_commits_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/git/commits{/sha}","comments_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/comments{/number}","issue_comment_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues/comments{/number}","contents_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/contents/{+path}","compare_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/merges","archive_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/downloads","issues_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues{/number}","pulls_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls{/number}","milestones_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/milestones{/number}","notifications_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/labels{/name}","releases_url":"https://api.github.com/repos/Antidote-for-Tox/Antidote/releases{/id}","created_at":"2014-07-19T12:35:35Z","updated_at":"2015-06-24T10:24:19Z","pushed_at":"2015-07-02T18:54:02Z","git_url":"git://github.com/Antidote-for-Tox/Antidote.git","ssh_url":"git@github.com:Antidote-for-Tox/Antidote.git","clone_url":"https://github.com/Antidote-for-Tox/Antidote.git","svn_url":"https://github.com/Antidote-for-Tox/Antidote","homepage":null,"size":32755,"stargazers_count":102,"watchers_count":102,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":10,"forks":26,"open_issues":10,"watchers":102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/31"},"html":{"href":"https://github.com/Antidote-for-Tox/Antidote/pull/31"},"issue":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues/31"},"comments":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/Antidote-for-Tox/Antidote/statuses/af027ff8f34c3aeb0e7ad861e533482b28ba70da"}}}}