mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
fixed topic unlock
This commit is contained in:
@@ -36,7 +36,6 @@ var RDB = require('./redis.js'),
|
|||||||
ThreadTools.lock = function(tid, uid, socket) {
|
ThreadTools.lock = function(tid, uid, socket) {
|
||||||
ThreadTools.privileges(tid, uid, function(privileges) {
|
ThreadTools.privileges(tid, uid, function(privileges) {
|
||||||
if (privileges.editable) {
|
if (privileges.editable) {
|
||||||
// Mark thread as locked
|
|
||||||
topics.setTopicField(tid, 'locked', 1);
|
topics.setTopicField(tid, 'locked', 1);
|
||||||
|
|
||||||
if (socket) {
|
if (socket) {
|
||||||
@@ -57,8 +56,8 @@ var RDB = require('./redis.js'),
|
|||||||
ThreadTools.unlock = function(tid, uid, socket) {
|
ThreadTools.unlock = function(tid, uid, socket) {
|
||||||
ThreadTools.privileges(tid, uid, function(privileges) {
|
ThreadTools.privileges(tid, uid, function(privileges) {
|
||||||
if (privileges.editable) {
|
if (privileges.editable) {
|
||||||
RDB.del('tid:' + tid + ':locked');
|
topics.setTopicField(tid, 'locked', 0);
|
||||||
|
|
||||||
if (socket) {
|
if (socket) {
|
||||||
io.sockets.in('topic_' + tid).emit('event:topic_unlocked', {
|
io.sockets.in('topic_' + tid).emit('event:topic_unlocked', {
|
||||||
tid: tid,
|
tid: tid,
|
||||||
|
|||||||
Reference in New Issue
Block a user