diff options
author | Georg Ehrke <developer@georgehrke.com> | 2017-04-24 11:39:03 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2017-04-26 09:26:53 +0200 |
commit | 60f9ed6241c3f7441f41bbd87d36c6f9e04c974b (patch) | |
tree | bb0516c335a90ee86dcd69c44a0740009e157d9d /core/Controller/ContactsMenuController.php | |
parent | 7386bea23fc7bb95ec4073a33abc9069b587581e (diff) | |
download | nextcloud-server-60f9ed6241c3f7441f41bbd87d36c6f9e04c974b.tar.gz nextcloud-server-60f9ed6241c3f7441f41bbd87d36c6f9e04c974b.zip |
add contactsmenu popover
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'core/Controller/ContactsMenuController.php')
-rw-r--r-- | core/Controller/ContactsMenuController.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/Controller/ContactsMenuController.php b/core/Controller/ContactsMenuController.php index b0e0e0c6a77..bbb990f1a4f 100644 --- a/core/Controller/ContactsMenuController.php +++ b/core/Controller/ContactsMenuController.php @@ -26,6 +26,7 @@ namespace OC\Core\Controller; use OC\Contacts\ContactsMenu\Manager; use OCP\AppFramework\Controller; +use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\IRequest; use OCP\IUserSession; @@ -59,4 +60,20 @@ class ContactsMenuController extends Controller { return $this->manager->getEntries($this->userSession->getUser(), $filter); } + /** + * @NoAdminRequired + * + * @param integer $shareType + * @param string $shareWith + * @return JSONResponse + */ + public function findOne($shareType, $shareWith) { + $contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith); + + if ($contact) { + return $contact; + } else { + return new JSONResponse([], Http::STATUS_NOT_FOUND); + } + } } |