def on_join_main(data): room = data["room"] join_room(room) print("user joined room " + room) socketio.emit("joined-mainid", room=room) tile_types = boxer_app.host_worker.get_tile_types( {"user_id": data["user_id"]}) return tile_types
def logout(page_id): print("in logout") user_id = current_user.get_id() socketio.emit('close-user-windows', {"originator": page_id}, namespace='/library', room=user_id) socketio.emit('close-user-windows', {"originator": page_id}, namespace='/main', room=user_id) logout_user() return redirect(url_for("login"))
def stop_spinner(user_id=None): if user_id is None: user_id = current_user.get_id() socketio.emit('stop-spinner', {}, namespace='/library', room=user_id)
def refresh_selector_list(self, user_obj=None): if user_obj is None: user_obj = current_user socketio.emit("refresh-{}-selector".format(self.res_type), {}, namespace='/library', room=user_obj.get_id())
def update_selector_row(self, res_dict): user_obj = current_user socketio.emit("update-{}-selector-row".format(self.res_type), res_dict, namespace='/library', room=user_obj.get_id())
def stop_library_spinner(self, library_id): print("stopping the library spinner") socketio.emit('stop-spinner', {}, namespace='/library', room=library_id)
def clear_um_message(self, library_id): socketio.emit('clear-status-msg', {}, namespace='/library', room=library_id)
def show_um_message(self, message, library_id, timeout=3): data = {"message": message, "timeout": timeout} socketio.emit('show-status-msg', data, namespace='/library', room=library_id)
def doflash(message, alert_type='alert-info', user_id=None): if user_id is None: user_id = current_user.get_id() data = {"message": message, "alert_type": alert_type} socketio.emit('stop-spinner', data, namespace='/library', room=user_id)