Compare commits

..

1 Commits

Author SHA1 Message Date
5ea5020a16 basic support for pagination 2018-07-26 09:36:37 -04:00
2 changed files with 3 additions and 5 deletions

View File

@ -28,17 +28,16 @@ def qm_only(msg=""):
def _nop(*args, **kwargs): def _nop(*args, **kwargs):
data = args[0] data = args[0]
room = data.get("room") room = data.get("room")
res = db.get_quest_meta(quest_id=room) res = db.get_quest_meta(room)
if not res: if not res:
return msg return msg
if session.get("user_id") != res[3]: if session.get("user_id") != res[2]:
return msg return msg
return func(*args, **kwargs) return func(*args, **kwargs)
return _nop return _nop
return actual_decorator return actual_decorator
@socketio.on('joined') @socketio.on('joined')
def joined(data): def joined(data):
""" """

View File

@ -5,7 +5,7 @@ var tid = setInterval( function () {
clearInterval( tid ); clearInterval( tid );
document.getElementById('chatWindow').scrollTop = document.getElementById('chatWindow').scrollHeight; document.getElementById('chatWindow').scrollTop = document.getElementById('chatWindow').scrollHeight;
socket = io.connect('https://' + document.domain + '/anonkun:' + location.port); socket = io.connect('https://' + document.domain + location.port);
socket.on('connect', function() { socket.on('connect', function() {
socket.emit('joined', {room: room_id}); socket.emit('joined', {room: room_id});
}); });
@ -223,7 +223,6 @@ function makePost() {
let text = qparea.value.trim(); let text = qparea.value.trim();
qparea.value = ''; qparea.value = '';
if (text == '') { return; } if (text == '') { return; }
console.log(page_num);
socket.emit('new_post', {post: text, page_num: page_num, room: room_id}); socket.emit('new_post', {post: text, page_num: page_num, room: room_id});
} }
function edit_post(post_id) { function edit_post(post_id) {