v3 client: fix chat flagging

This commit is contained in:
Matteo Pagliazzi
2016-05-18 16:50:50 +02:00
parent 2f934455ad
commit 73dd9f5920

View File

@@ -49,18 +49,20 @@ habitrpg
$scope.reportAbuse = function(reporter, message, groupId) { $scope.reportAbuse = function(reporter, message, groupId) {
message.flags[reporter._id] = true; message.flags[reporter._id] = true;
Chat.utils.flagChatMessage({gid: groupId, messageId: message.id}, undefined, function(data){ Chat.flagChatMessage(groupId, message.id)
Notification.text(window.env.t('abuseReported')); .then(function(data){
$scope.$close(); Notification.text(window.env.t('abuseReported'));
}); $scope.$close();
});
}; };
$scope.clearFlagCount = function(message, groupId) { $scope.clearFlagCount = function(message, groupId) {
Chat.utils.clearFlagCount({gid: groupId, messageId: message.id}, undefined, function(data){ Chat.clearFlagCount(groupId, message.id)
message.flagCount = 0; .then(function(data){
Notification.text("Flags cleared"); message.flagCount = 0;
$scope.$close(); Notification.text("Flags cleared");
}); $scope.$close();
});
} }
} }
]); ]);