mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-08 07:40:05 +01:00
fixing socket returns to emit to everybody in the room (on thread locking/deletion)
This commit is contained in:
@@ -138,7 +138,6 @@
|
||||
});
|
||||
|
||||
socket.on('event:topic_deleted', function(data) {
|
||||
console.log('deleted');
|
||||
if (data.tid === tid && data.status === 'ok') {
|
||||
set_locked_state(true);
|
||||
set_delete_state(true);
|
||||
@@ -146,7 +145,6 @@
|
||||
});
|
||||
|
||||
socket.on('event:topic_restored', function(data) {
|
||||
console.log('restored');
|
||||
if (data.tid === tid && data.status === 'ok') {
|
||||
set_locked_state(false);
|
||||
set_delete_state(false);
|
||||
@@ -154,14 +152,12 @@
|
||||
});
|
||||
|
||||
socket.on('event:topic_locked', function(data) {
|
||||
console.log('locked');
|
||||
if (data.tid === tid && data.status === 'ok') {
|
||||
set_locked_state(true);
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('event:topic_unlocked', function(data) {
|
||||
console.log('unlocked');
|
||||
if (data.tid === tid && data.status === 'ok') {
|
||||
set_locked_state(false);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ var RDB = require('./redis.js'),
|
||||
RDB.set('tid:' + tid + ':locked', 1);
|
||||
|
||||
if (socket) {
|
||||
socket.in('topic_' + tid).emit('event:topic_locked', {
|
||||
io.sockets.in('topic_' + tid).emit('event:topic_locked', {
|
||||
tid: tid,
|
||||
status: 'ok'
|
||||
});
|
||||
@@ -165,7 +165,7 @@ var RDB = require('./redis.js'),
|
||||
RDB.del('tid:' + tid + ':locked');
|
||||
|
||||
if (socket) {
|
||||
socket.in('topic_' + tid).emit('event:topic_unlocked', {
|
||||
io.sockets.in('topic_' + tid).emit('event:topic_unlocked', {
|
||||
tid: tid,
|
||||
status: 'ok'
|
||||
});
|
||||
@@ -182,7 +182,7 @@ var RDB = require('./redis.js'),
|
||||
Topics.lock(tid, uid);
|
||||
|
||||
if (socket) {
|
||||
socket.in('topic_' + tid).emit('event:topic_deleted', {
|
||||
io.sockets.in('topic_' + tid).emit('event:topic_deleted', {
|
||||
tid: tid,
|
||||
status: 'ok'
|
||||
});
|
||||
@@ -199,7 +199,7 @@ var RDB = require('./redis.js'),
|
||||
Topics.unlock(tid, uid);
|
||||
|
||||
if (socket) {
|
||||
socket.in('topic_' + tid).emit('event:topic_restored', {
|
||||
io.sockets.in('topic_' + tid).emit('event:topic_restored', {
|
||||
tid: tid,
|
||||
status: 'ok'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user