{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/mail/pulls/comments/52187510","id":52187510,"diff_hunk":"@@ -0,0 +1,52 @@\n+<?php\n+\n+/**\n+ * ownCloud - Mail\n+ *\n+ * This file is licensed under the Affero General Public License version 3 or\n+ * later. See the COPYING file.\n+ *\n+ * @author Christoph Wurst <christoph@winzerhof-wurst.at>\n+ * @copyright Christoph Wurst 2016\n+ */\n+\n+namespace OCA\\Mail\\Db;\n+\n+use OCP\\AppFramework\\Db\\Mapper;\n+use OCP\\IDb;\n+\n+class CollectedAddressMapper extends Mapper {\n+\n+\t/**\n+\t * @param IDb $db\n+\t */\n+\tpublic function __construct(IDb $db) {\n+\t\tparent::__construct($db, 'mail_collected_addresses');\n+\t}\n+\n+\t/**\n+\t * Find email addresses by query string\n+\t *\n+\t * @param string $userId\n+\t * @param string $query\n+\t * @return CollectedAddress[]\n+\t */\n+\tpublic function findMatching($userId, $query) {\n+\t\t$sql = 'SELECT * FROM *PREFIX*mail_collected_addresses WHERE `user_id` = ? AND `email` ILIKE ?';","path":"lib/db/collectedaddressmapper.php","position":35,"original_position":35,"commit_id":"bccb3fd89732138e4720672cd2d8152318669633","original_commit_id":"e59e365e60ffe073a3dfc1bd3724db228b2217f1","user":{"login":"DeepDiver1975","id":1005065,"avatar_url":"https://avatars.githubusercontent.com/u/1005065?v=3","gravatar_id":"","url":"https://api.github.com/users/DeepDiver1975","html_url":"https://github.com/DeepDiver1975","followers_url":"https://api.github.com/users/DeepDiver1975/followers","following_url":"https://api.github.com/users/DeepDiver1975/following{/other_user}","gists_url":"https://api.github.com/users/DeepDiver1975/gists{/gist_id}","starred_url":"https://api.github.com/users/DeepDiver1975/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeepDiver1975/subscriptions","organizations_url":"https://api.github.com/users/DeepDiver1975/orgs","repos_url":"https://api.github.com/users/DeepDiver1975/repos","events_url":"https://api.github.com/users/DeepDiver1975/events{/privacy}","received_events_url":"https://api.github.com/users/DeepDiver1975/received_events","type":"User","site_admin":false},"body":"wildcard character is % - so you can pass in as parameter :\r\n\r\n```php\r\n'%' . $query . '%'","created_at":"2016-02-08T16:06:16Z","updated_at":"2016-02-08T16:06:16Z","html_url":"https://github.com/owncloud/mail/pull/1276#discussion_r52187510","pull_request_url":"https://api.github.com/repos/owncloud/mail/pulls/1276","_links":{"self":{"href":"https://api.github.com/repos/owncloud/mail/pulls/comments/52187510"},"html":{"href":"https://github.com/owncloud/mail/pull/1276#discussion_r52187510"},"pull_request":{"href":"https://api.github.com/repos/owncloud/mail/pulls/1276"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/mail/pulls/1276","id":58552726,"html_url":"https://github.com/owncloud/mail/pull/1276","diff_url":"https://github.com/owncloud/mail/pull/1276.diff","patch_url":"https://github.com/owncloud/mail/pull/1276.patch","issue_url":"https://api.github.com/repos/owncloud/mail/issues/1276","number":1276,"state":"open","locked":false,"title":"Address collector","user":{"login":"ChristophWurst","id":1374172,"avatar_url":"https://avatars.githubusercontent.com/u/1374172?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristophWurst","html_url":"https://github.com/ChristophWurst","followers_url":"https://api.github.com/users/ChristophWurst/followers","following_url":"https://api.github.com/users/ChristophWurst/following{/other_user}","gists_url":"https://api.github.com/users/ChristophWurst/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristophWurst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristophWurst/subscriptions","organizations_url":"https://api.github.com/users/ChristophWurst/orgs","repos_url":"https://api.github.com/users/ChristophWurst/repos","events_url":"https://api.github.com/users/ChristophWurst/events{/privacy}","received_events_url":"https://api.github.com/users/ChristophWurst/received_events","type":"User","site_admin":false},"body":"Adds all addresses of sent mails (to, cc, bcc) to a db table, so that those addresses can then be used for auto-completion.\r\n\r\nThis is a very simple implementation, it only saves the bare email address. Adding more information (label, recipient name) can be done in another PR as that might need some advanced update-logic.\r\n\r\nWe should also think about a way for users to delete one of those entries…\r\n\r\nTODO:\r\n- [ ] fix sql matching\r\n- [x] update/add unit tests\r\n\r\nimplements #879\r\nfixes #1254","created_at":"2016-02-07T18:14:15Z","updated_at":"2016-02-08T16:06:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29bd2c69a74c704f62f56ecb6bc337ebc5fff350","assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/mail/milestones/6","html_url":"https://github.com/owncloud/mail/milestones/0.4%20%E2%80%93%20small%20innovations!","labels_url":"https://api.github.com/repos/owncloud/mail/milestones/6/labels","id":1280109,"number":6,"title":"0.4 – small innovations!","description":"Together with ownCloud 9.0","creator":{"login":"jancborchardt","id":925062,"avatar_url":"https://avatars.githubusercontent.com/u/925062?v=3","gravatar_id":"","url":"https://api.github.com/users/jancborchardt","html_url":"https://github.com/jancborchardt","followers_url":"https://api.github.com/users/jancborchardt/followers","following_url":"https://api.github.com/users/jancborchardt/following{/other_user}","gists_url":"https://api.github.com/users/jancborchardt/gists{/gist_id}","starred_url":"https://api.github.com/users/jancborchardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jancborchardt/subscriptions","organizations_url":"https://api.github.com/users/jancborchardt/orgs","repos_url":"https://api.github.com/users/jancborchardt/repos","events_url":"https://api.github.com/users/jancborchardt/events{/privacy}","received_events_url":"https://api.github.com/users/jancborchardt/received_events","type":"User","site_admin":false},"open_issues":114,"closed_issues":15,"state":"open","created_at":"2015-08-30T13:35:47Z","updated_at":"2016-02-07T20:10:08Z","due_on":"2016-03-07T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/mail/pulls/1276/commits","review_comments_url":"https://api.github.com/repos/owncloud/mail/pulls/1276/comments","review_comment_url":"https://api.github.com/repos/owncloud/mail/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/mail/issues/1276/comments","statuses_url":"https://api.github.com/repos/owncloud/mail/statuses/bccb3fd89732138e4720672cd2d8152318669633","head":{"label":"owncloud:address-collector","ref":"address-collector","sha":"bccb3fd89732138e4720672cd2d8152318669633","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":8604367,"name":"mail","full_name":"owncloud/mail","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/mail","description":"ownCloud Mail app","fork":false,"url":"https://api.github.com/repos/owncloud/mail","forks_url":"https://api.github.com/repos/owncloud/mail/forks","keys_url":"https://api.github.com/repos/owncloud/mail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/mail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/mail/teams","hooks_url":"https://api.github.com/repos/owncloud/mail/hooks","issue_events_url":"https://api.github.com/repos/owncloud/mail/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/mail/events","assignees_url":"https://api.github.com/repos/owncloud/mail/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/mail/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/mail/tags","blobs_url":"https://api.github.com/repos/owncloud/mail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/mail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/mail/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/mail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/mail/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/mail/languages","stargazers_url":"https://api.github.com/repos/owncloud/mail/stargazers","contributors_url":"https://api.github.com/repos/owncloud/mail/contributors","subscribers_url":"https://api.github.com/repos/owncloud/mail/subscribers","subscription_url":"https://api.github.com/repos/owncloud/mail/subscription","commits_url":"https://api.github.com/repos/owncloud/mail/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/mail/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/mail/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/mail/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/mail/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/mail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/mail/merges","archive_url":"https://api.github.com/repos/owncloud/mail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/mail/downloads","issues_url":"https://api.github.com/repos/owncloud/mail/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/mail/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/mail/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/mail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/mail/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/mail/releases{/id}","deployments_url":"https://api.github.com/repos/owncloud/mail/deployments","created_at":"2013-03-06T13:51:00Z","updated_at":"2016-02-03T20:55:10Z","pushed_at":"2016-02-08T15:55:35Z","git_url":"git://github.com/owncloud/mail.git","ssh_url":"git@github.com:owncloud/mail.git","clone_url":"https://github.com/owncloud/mail.git","svn_url":"https://github.com/owncloud/mail","homepage":"https://apps.owncloud.com/content/show.php/Mail?content=169914","size":8761,"stargazers_count":226,"watchers_count":226,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":67,"mirror_url":null,"open_issues_count":204,"forks":67,"open_issues":204,"watchers":226,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"ba3f5aee4bb07d12734391a793c72539420ef740","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":8604367,"name":"mail","full_name":"owncloud/mail","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/mail","description":"ownCloud Mail app","fork":false,"url":"https://api.github.com/repos/owncloud/mail","forks_url":"https://api.github.com/repos/owncloud/mail/forks","keys_url":"https://api.github.com/repos/owncloud/mail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/mail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/mail/teams","hooks_url":"https://api.github.com/repos/owncloud/mail/hooks","issue_events_url":"https://api.github.com/repos/owncloud/mail/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/mail/events","assignees_url":"https://api.github.com/repos/owncloud/mail/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/mail/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/mail/tags","blobs_url":"https://api.github.com/repos/owncloud/mail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/mail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/mail/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/mail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/mail/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/mail/languages","stargazers_url":"https://api.github.com/repos/owncloud/mail/stargazers","contributors_url":"https://api.github.com/repos/owncloud/mail/contributors","subscribers_url":"https://api.github.com/repos/owncloud/mail/subscribers","subscription_url":"https://api.github.com/repos/owncloud/mail/subscription","commits_url":"https://api.github.com/repos/owncloud/mail/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/mail/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/mail/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/mail/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/mail/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/mail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/mail/merges","archive_url":"https://api.github.com/repos/owncloud/mail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/mail/downloads","issues_url":"https://api.github.com/repos/owncloud/mail/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/mail/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/mail/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/mail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/mail/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/mail/releases{/id}","deployments_url":"https://api.github.com/repos/owncloud/mail/deployments","created_at":"2013-03-06T13:51:00Z","updated_at":"2016-02-03T20:55:10Z","pushed_at":"2016-02-08T15:55:35Z","git_url":"git://github.com/owncloud/mail.git","ssh_url":"git@github.com:owncloud/mail.git","clone_url":"https://github.com/owncloud/mail.git","svn_url":"https://github.com/owncloud/mail","homepage":"https://apps.owncloud.com/content/show.php/Mail?content=169914","size":8761,"stargazers_count":226,"watchers_count":226,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":67,"mirror_url":null,"open_issues_count":204,"forks":67,"open_issues":204,"watchers":226,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/mail/pulls/1276"},"html":{"href":"https://github.com/owncloud/mail/pull/1276"},"issue":{"href":"https://api.github.com/repos/owncloud/mail/issues/1276"},"comments":{"href":"https://api.github.com/repos/owncloud/mail/issues/1276/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/mail/pulls/1276/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/mail/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/mail/pulls/1276/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/mail/statuses/bccb3fd89732138e4720672cd2d8152318669633"}}}}