Added some logic for adding flags

This commit is contained in:
Blade Barringer 2014-12-05 07:03:33 -06:00 committed by Matteo Pagliazzi
parent 74b94e6764
commit 5a6c9fbf84

View file

@ -148,6 +148,10 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
})
}
$scope.reportAbuse = function(reporter, message) {
if(!message.flags) message.flags = {};
message.flags[User.user._id] = true;
// Post to API should look something like this
//$http.post(ApiUrlService.get() + '/api/v2/groups/' + group._id + '/chat/' + message.id + '/flag');
Notification.text(window.env.t('abuseReported'));
$rootScope.User.sync();
$scope.$close();