{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/client/pulls/comments/43661074","id":43661074,"diff_hunk":"@@ -0,0 +1,161 @@\n+/*\n+ * Copyright (C) by Roeland Jago Douma <roeland@owncloud.com>\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; version 2 of the License.\n+ *\n+ * This program is distributed in the hope that it will be useful, but\n+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n+ * for more details.\n+ */\n+\n+#include \"sharee.h\"\n+#include \"ocsshareejob.h\"\n+\n+namespace OCC {\n+\n+Sharee::Sharee(const QString shareWith,\n+               const QString displayName,\n+               const Type type)\n+: _shareWith(shareWith),\n+  _displayName(displayName),\n+  _type(type)\n+{\n+}\n+    \n+QString Sharee::shareWith() const\n+{\n+    return _shareWith;\n+}\n+\n+QString Sharee::displayName() const\n+{\n+    return _displayName;\n+}\n+\n+Sharee::Type Sharee::type() const\n+{\n+    return _type;\n+}\n+\n+\n+ShareeModel::ShareeModel(AccountPtr account,\n+                         const QString search,\n+                         const QString type,\n+                         QObject *parent)\n+: QAbstractTableModel(parent),\n+  _account(account),\n+  _search(search),\n+  _type(type)\n+{\n+    OcsShareeJob *job = new OcsShareeJob(_account, this);\n+    connect(job, SIGNAL(shareeJobFinished(QVariantMap)), SLOT(shareesFetched(QVariantMap)));\n+    job->getSharees(_search, _type, 1, 50);\n+}\n+\n+void ShareeModel::shareesFetched(const QVariantMap &reply)\n+{\n+    qDebug() << Q_FUNC_INFO << reply;\n+\n+    auto data = reply.value(\"ocs\").toMap().value(\"data\").toMap();\n+\n+    QVector<QSharedPointer<Sharee>> newSharees;","path":"src/gui/sharee.cpp","position":64,"original_position":64,"commit_id":"51d51f70d8b697f0fd0989b76fdb1fe7744422fd","original_commit_id":"51d51f70d8b697f0fd0989b76fdb1fe7744422fd","user":{"login":"ogoffart","id":959326,"avatar_url":"https://avatars.githubusercontent.com/u/959326?v=3","gravatar_id":"","url":"https://api.github.com/users/ogoffart","html_url":"https://github.com/ogoffart","followers_url":"https://api.github.com/users/ogoffart/followers","following_url":"https://api.github.com/users/ogoffart/following{/other_user}","gists_url":"https://api.github.com/users/ogoffart/gists{/gist_id}","starred_url":"https://api.github.com/users/ogoffart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogoffart/subscriptions","organizations_url":"https://api.github.com/users/ogoffart/orgs","repos_url":"https://api.github.com/users/ogoffart/repos","events_url":"https://api.github.com/users/ogoffart/events{/privacy}","received_events_url":"https://api.github.com/users/ogoffart/received_events","type":"User","site_admin":false},"body":"`>>`  is fine, it's C++11 but all compiler we use already support this syntax.","created_at":"2015-11-02T18:20:12Z","updated_at":"2015-11-02T18:20:12Z","html_url":"https://github.com/owncloud/client/pull/4055#discussion_r43661074","pull_request_url":"https://api.github.com/repos/owncloud/client/pulls/4055","_links":{"self":{"href":"https://api.github.com/repos/owncloud/client/pulls/comments/43661074"},"html":{"href":"https://github.com/owncloud/client/pull/4055#discussion_r43661074"},"pull_request":{"href":"https://api.github.com/repos/owncloud/client/pulls/4055"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/client/pulls/4055","id":49381406,"html_url":"https://github.com/owncloud/client/pull/4055","diff_url":"https://github.com/owncloud/client/pull/4055.diff","patch_url":"https://github.com/owncloud/client/pull/4055.patch","issue_url":"https://api.github.com/repos/owncloud/client/issues/4055","number":4055,"state":"open","locked":false,"title":"[WIP] User group sharing","user":{"login":"rullzer","id":45821,"avatar_url":"https://avatars.githubusercontent.com/u/45821?v=3","gravatar_id":"","url":"https://api.github.com/users/rullzer","html_url":"https://github.com/rullzer","followers_url":"https://api.github.com/users/rullzer/followers","following_url":"https://api.github.com/users/rullzer/following{/other_user}","gists_url":"https://api.github.com/users/rullzer/gists{/gist_id}","starred_url":"https://api.github.com/users/rullzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rullzer/subscriptions","organizations_url":"https://api.github.com/users/rullzer/orgs","repos_url":"https://api.github.com/users/rullzer/repos","events_url":"https://api.github.com/users/rullzer/events{/privacy}","received_events_url":"https://api.github.com/users/rullzer/received_events","type":"User","site_admin":false},"body":"For https://github.com/owncloud/client/issues/3737\r\n\r\nWith the new sharing and OCS code in place this was a lot easier to write. Not really finished yet. But sharing with user/groups works!\r\n\r\nThere is still a lot of stuff that needs to be connected in the dialog.\r\nThe code needs comments. And more cleanup. \r\n\r\nBut overall it is looking promising :)\r\n\r\nTODO:\r\n- [ ] Comments\r\n- [ ] Only allow this on >8.2 servers (Sharee API)\r\n- [ ] Connect lots of stuff in the dialog\r\n- [ ] Cleanup sharee stuff\r\n- [ ] Better UI\r\n\r\nFor the last point I think it is best if someone with more estethic taste has a look once this is merged ;)\r\n\r\nNow time for bed.\r\n\r\n@MTRichards FYI\r\nCC: @dragotin @ckamm @ogoffart @guruz ","created_at":"2015-11-01T21:30:19Z","updated_at":"2015-11-02T18:20:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6e7e9206568ec413b6d09de79f9523b04cfaed9","assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/client/milestones/25","html_url":"https://github.com/owncloud/client/milestones/2.1-next","labels_url":"https://api.github.com/repos/owncloud/client/milestones/25/labels","id":1170965,"number":25,"title":"2.1-next","description":"","creator":{"login":"cmonteroluque","id":879976,"avatar_url":"https://avatars.githubusercontent.com/u/879976?v=3","gravatar_id":"","url":"https://api.github.com/users/cmonteroluque","html_url":"https://github.com/cmonteroluque","followers_url":"https://api.github.com/users/cmonteroluque/followers","following_url":"https://api.github.com/users/cmonteroluque/following{/other_user}","gists_url":"https://api.github.com/users/cmonteroluque/gists{/gist_id}","starred_url":"https://api.github.com/users/cmonteroluque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmonteroluque/subscriptions","organizations_url":"https://api.github.com/users/cmonteroluque/orgs","repos_url":"https://api.github.com/users/cmonteroluque/repos","events_url":"https://api.github.com/users/cmonteroluque/events{/privacy}","received_events_url":"https://api.github.com/users/cmonteroluque/received_events","type":"User","site_admin":false},"open_issues":115,"closed_issues":94,"state":"open","created_at":"2015-06-18T15:57:49Z","updated_at":"2015-11-02T17:00:30Z","due_on":"2015-11-02T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/client/pulls/4055/commits","review_comments_url":"https://api.github.com/repos/owncloud/client/pulls/4055/comments","review_comment_url":"https://api.github.com/repos/owncloud/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/client/issues/4055/comments","statuses_url":"https://api.github.com/repos/owncloud/client/statuses/51d51f70d8b697f0fd0989b76fdb1fe7744422fd","head":{"label":"owncloud:user_group_sharing","ref":"user_group_sharing","sha":"51d51f70d8b697f0fd0989b76fdb1fe7744422fd","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":5550623,"name":"client","full_name":"owncloud/client","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/client","description":"Repository for the ownCloud Desktop Syncing Client","fork":false,"url":"https://api.github.com/repos/owncloud/client","forks_url":"https://api.github.com/repos/owncloud/client/forks","keys_url":"https://api.github.com/repos/owncloud/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/client/teams","hooks_url":"https://api.github.com/repos/owncloud/client/hooks","issue_events_url":"https://api.github.com/repos/owncloud/client/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/client/events","assignees_url":"https://api.github.com/repos/owncloud/client/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/client/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/client/tags","blobs_url":"https://api.github.com/repos/owncloud/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/client/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/client/languages","stargazers_url":"https://api.github.com/repos/owncloud/client/stargazers","contributors_url":"https://api.github.com/repos/owncloud/client/contributors","subscribers_url":"https://api.github.com/repos/owncloud/client/subscribers","subscription_url":"https://api.github.com/repos/owncloud/client/subscription","commits_url":"https://api.github.com/repos/owncloud/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/client/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/client/merges","archive_url":"https://api.github.com/repos/owncloud/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/client/downloads","issues_url":"https://api.github.com/repos/owncloud/client/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/client/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/client/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/client/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/client/releases{/id}","created_at":"2012-08-25T10:44:53Z","updated_at":"2015-11-02T10:27:33Z","pushed_at":"2015-11-02T12:12:10Z","git_url":"git://github.com/owncloud/client.git","ssh_url":"git@github.com:owncloud/client.git","clone_url":"https://github.com/owncloud/client.git","svn_url":"https://github.com/owncloud/client","homepage":null,"size":128323,"stargazers_count":574,"watchers_count":574,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":328,"mirror_url":null,"open_issues_count":452,"forks":328,"open_issues":452,"watchers":574,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"3993a7f636f0a06b71eb3cc97cdb7a9818c02221","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":5550623,"name":"client","full_name":"owncloud/client","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/client","description":"Repository for the ownCloud Desktop Syncing Client","fork":false,"url":"https://api.github.com/repos/owncloud/client","forks_url":"https://api.github.com/repos/owncloud/client/forks","keys_url":"https://api.github.com/repos/owncloud/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/client/teams","hooks_url":"https://api.github.com/repos/owncloud/client/hooks","issue_events_url":"https://api.github.com/repos/owncloud/client/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/client/events","assignees_url":"https://api.github.com/repos/owncloud/client/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/client/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/client/tags","blobs_url":"https://api.github.com/repos/owncloud/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/client/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/client/languages","stargazers_url":"https://api.github.com/repos/owncloud/client/stargazers","contributors_url":"https://api.github.com/repos/owncloud/client/contributors","subscribers_url":"https://api.github.com/repos/owncloud/client/subscribers","subscription_url":"https://api.github.com/repos/owncloud/client/subscription","commits_url":"https://api.github.com/repos/owncloud/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/client/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/client/merges","archive_url":"https://api.github.com/repos/owncloud/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/client/downloads","issues_url":"https://api.github.com/repos/owncloud/client/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/client/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/client/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/client/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/client/releases{/id}","created_at":"2012-08-25T10:44:53Z","updated_at":"2015-11-02T10:27:33Z","pushed_at":"2015-11-02T12:12:10Z","git_url":"git://github.com/owncloud/client.git","ssh_url":"git@github.com:owncloud/client.git","clone_url":"https://github.com/owncloud/client.git","svn_url":"https://github.com/owncloud/client","homepage":null,"size":128323,"stargazers_count":574,"watchers_count":574,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":328,"mirror_url":null,"open_issues_count":452,"forks":328,"open_issues":452,"watchers":574,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/client/pulls/4055"},"html":{"href":"https://github.com/owncloud/client/pull/4055"},"issue":{"href":"https://api.github.com/repos/owncloud/client/issues/4055"},"comments":{"href":"https://api.github.com/repos/owncloud/client/issues/4055/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/client/pulls/4055/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/client/pulls/4055/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/client/statuses/51d51f70d8b697f0fd0989b76fdb1fe7744422fd"}}}}