WIP allow list changes

This commit is contained in:
ansuz
2020-02-21 08:18:05 -05:00
parent 597f417ad6
commit 791aad53f2
3 changed files with 38 additions and 26 deletions

View File

@@ -6,17 +6,15 @@ const BatchRead = require("../batch-read");
const WriteQueue = require("../write-queue");
const Core = require("./core");
const Util = require("../common-util");
const HK = require("../hk-util");
const batchMetadata = BatchRead("GET_METADATA");
Data.getMetadata = function (Env, channel, cb/* , Server */) {
if (!Core.isValidId(channel)) { return void cb('INVALID_CHAN'); }
if (channel.length !== 32) { return cb("INVALID_CHAN_LENGTH"); }
if (channel.length !== HK.STANDARD_CHANNEL_LENGTH) { return cb("INVALID_CHAN_LENGTH"); }
// XXX get metadata from the server cache if it is available
batchMetadata(channel, cb, function (done) {
Env.batchMetadata(channel, cb, function (done) {
var ref = {};
var lineHandler = Meta.createLineHandler(ref, Env.Log.error);
return void Env.msgStore.readChannelMetadata(channel, lineHandler, function (err) {
if (err) {
// stream errors?
@@ -118,6 +116,9 @@ Data.setMetadata = function (Env, safeKey, data, cb, Server) {
// kick any current users from the channel
// if they aren't on it.
// review Server.channelBroadcast as used for EEXPIRED
// send them to the user in question, from historyKeeper
cb(void 0, metadata);
next();