Removed tripcodes for now.

Added optional tripcode removal config item in hot.js
no-tripcode
Avril 2 years ago
parent 70a2dddb6e
commit a781f53c38
Signed by: flanchan
GPG Key ID: 966FE03CC0E0B199

@ -25,6 +25,8 @@ this.hot = {
INTER_BOARD_NAVIGATION: true, INTER_BOARD_NAVIGATION: true,
/* Disable tripcodes: Set to `null` to stop adding them, set to a specific string to have all tripcodes return that string (doesn't apply to `SPECIAL_TRIPCODES`.) */
NOTRIP: "(unbound)",
SPECIAL_TRIPCODES: { SPECIAL_TRIPCODES: {
kyubey: "/人◕ ‿‿ ◕人\", kyubey: "/人◕ ‿‿ ◕人\",
}, },

@ -844,12 +844,17 @@ function allocate_post(msg, client, callback) {
var parsed = common.parse_name(msg.name); var parsed = common.parse_name(msg.name);
post.name = parsed[0]; post.name = parsed[0];
var spec = STATE.hot.SPECIAL_TRIPCODES; var spec = STATE.hot.SPECIAL_TRIPCODES;
const notrip = (n, s) => {
const b =n ? "!" :
s ? "!!" : undefined;
if(b) return b + (STATE.hot.NOTRIP || "");
};
if (spec && parsed[1] && parsed[1] in spec) { if (spec && parsed[1] && parsed[1] in spec) {
post.trip = spec[parsed[1]]; post.trip = spec[parsed[1]];
} }
else if (parsed[1] || parsed[2]) { else if (parsed[1] || parsed[2]) {
var trip = "Can this just be a string?"; //tripcode.hash(parsed[1], parsed[2]); const trip = notrip(parsed[1], parsed[2]); //tripcode.hash(parsed[1], parsed[2]);
if (trip) if (trip && STATE.hot.NOTRIP !== null)
post.trip = trip; post.trip = trip;
} }
} }

@ -14,7 +14,7 @@ Tripcode.Algorithm = {
Sha256T: hash.Kana.ALGO_SHA256_TRUNCATED, Sha256T: hash.Kana.ALGO_SHA256_TRUNCATED,
}; };
Tripcode.make = (algo, salt) => { Tripcode.make = (algo, salt) => {
return new Tripcode(algo,salt);b return new Tripcode(algo,salt);
}; };
Object.freeze(Tripcode.Algorithm); Object.freeze(Tripcode.Algorithm);

Loading…
Cancel
Save