diff --git a/hot.js.example b/hot.js.example index f3f860a..8a699fb 100644 --- a/hot.js.example +++ b/hot.js.example @@ -25,6 +25,8 @@ this.hot = { 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: { kyubey: "/人◕ ‿‿ ◕人\", }, diff --git a/server/server.js b/server/server.js index fe3c7e2..30ced48 100644 --- a/server/server.js +++ b/server/server.js @@ -844,12 +844,17 @@ function allocate_post(msg, client, callback) { var parsed = common.parse_name(msg.name); post.name = parsed[0]; 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) { post.trip = spec[parsed[1]]; } else if (parsed[1] || parsed[2]) { - var trip = "Can this just be a string?"; //tripcode.hash(parsed[1], parsed[2]); - if (trip) + const trip = notrip(parsed[1], parsed[2]); //tripcode.hash(parsed[1], parsed[2]); + if (trip && STATE.hot.NOTRIP !== null) post.trip = trip; } } diff --git a/tripcode.js b/tripcode.js index 6e2226a..34a214d 100644 --- a/tripcode.js +++ b/tripcode.js @@ -14,7 +14,7 @@ Tripcode.Algorithm = { Sha256T: hash.Kana.ALGO_SHA256_TRUNCATED, }; Tripcode.make = (algo, salt) => { - return new Tripcode(algo,salt);b + return new Tripcode(algo,salt); }; Object.freeze(Tripcode.Algorithm);