From 60f9ed6241c3f7441f41bbd87d36c6f9e04c974b Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 24 Apr 2017 11:39:03 +0200 Subject: add contactsmenu popover Signed-off-by: Georg Ehrke --- core/Controller/ContactsMenuController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'core/Controller') 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); + } + } } -- cgit v1.2.3