From 3105eeb776a7185be111ead80a0d5948302cee3e Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 23 Jun 2015 20:55:40 +0000 Subject: [PATCH] Prepare conversation deletion in PHP code too --- appinfo/routes.php | 1 + controller/smscontroller.php | 8 ++++++++ js/public/app.js | 4 ++++ templates/main.php | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index 4d3aea0..3846f3d 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -17,6 +17,7 @@ $application->registerRoutes($this, array('routes' => array( array('name' => 'sms#index', 'url' => '/', 'verb' => 'GET'), array('name' => 'sms#retrieve_all_peers', 'url' => '/get/peerlist', 'verb' => 'GET'), array('name' => 'sms#get_conversation', 'url' => '/get/conversation', 'verb' => 'GET'), + array('name' => 'sms#delete_conversation', 'url' => '/delete/conversation', 'verb' => 'POST'), array('name' => 'sms#check_new_messages', 'url' => '/get/new_messages', 'verb' => 'GET'), array('name' => 'sms#set_country', 'url'=> '/set/country', 'verb' => 'POST'), array('name' => 'sms#get_country', 'url'=> '/get/country', 'verb' => 'GET'), diff --git a/controller/smscontroller.php b/controller/smscontroller.php index d599a10..5d81ab3 100644 --- a/controller/smscontroller.php +++ b/controller/smscontroller.php @@ -156,6 +156,14 @@ class SmsController extends Controller { "phoneNumbers" => $phoneNumbers, "msgCount" => $msgCount)); } + /** + * @NoAdminRequired + * @NoCSRFRequired + */ + public function deleteConversation ($contact) { + return new JSONResponse(array()); + } + /** * @NoAdminRequired * @NoCSRFRequired diff --git a/js/public/app.js b/js/public/app.js index 3274a01..a9cab5c 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -52,6 +52,10 @@ app.controller('OcSmsController', ['$scope', changeSelectedConversation($("a[mailbox-navigation='" + contact.nav + "']")); } }; + $scope.removeConversation = function() { + $.post(OC.generateUrl('/apps/ocsms/delete/conversation'), {"contact": g_curContactName}, function(data) { + }); + } $scope.addContact = function (ct) { $scope.$apply(function () { diff --git a/templates/main.php b/templates/main.php index 3eafc27..0ecbcdb 100644 --- a/templates/main.php +++ b/templates/main.php @@ -31,7 +31,7 @@ use \OCA\OcSms\Lib\CountryCodes;