1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-07-23 09:55:44 +00:00

Prepare conversation deletion in PHP code too

This commit is contained in:
Loic Blot 2015-06-23 20:55:40 +00:00
parent a83c494d47
commit 3105eeb776
4 changed files with 14 additions and 1 deletions

View File

@ -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'),

View File

@ -156,6 +156,14 @@ class SmsController extends Controller {
"phoneNumbers" => $phoneNumbers, "msgCount" => $msgCount));
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function deleteConversation ($contact) {
return new JSONResponse(array());
}
/**
* @NoAdminRequired
* @NoCSRFRequired

View File

@ -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 () {

View File

@ -31,7 +31,7 @@ use \OCA\OcSms\Lib\CountryCodes;
<div id="app-content">
<div id="app-content-header" style="display: none;">
<div id="ocsms-phone-label"></div><div id="ocsms-conversation-removal" class="icon-delete svn delete action"></div>
<div id="ocsms-phone-label"></div><div id="ocsms-conversation-removal" class="icon-delete svn delete action" ng-click="removeConversation();"></div>
<div id="ocsms-phone-opt-number"></div>
<div id="ocsms-phone-msg-nb"></div>