From 027b27c1b0cd72cfc6314a4d6d6288ff48ab70cd Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Thu, 15 Nov 2018 22:48:30 -0800 Subject: [PATCH] Bump max message length (#782) --- src/channel/chat.js | 5 ++--- templates/channel.pug | 2 +- www/js/util.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/channel/chat.js b/src/channel/chat.js index a4adc670..d726d3c0 100644 --- a/src/channel/chat.js +++ b/src/channel/chat.js @@ -164,8 +164,7 @@ ChatModule.prototype.handleChatMsg = function (user, data) { return; } - // Limit to 240 characters - data.msg = data.msg.substring(0, 240); + data.msg = data.msg.substring(0, 320); // Restrict new accounts/IPs from chatting and posting links if (this.restrictNewAccount(user, data)) { @@ -251,7 +250,7 @@ ChatModule.prototype.handlePm = function (user, data) { } - data.msg = data.msg.substring(0, 240); + data.msg = data.msg.substring(0, 320); var to = null; for (var i = 0; i < this.channel.users.length; i++) { if (this.channel.users[i].getLowerName() === data.to) { diff --git a/templates/channel.pug b/templates/channel.pug index 89e38daf..6baaa0ae 100644 --- a/templates/channel.pug +++ b/templates/channel.pug @@ -45,7 +45,7 @@ html(lang="en") span#modflair.label.label-default.pull-right.pointer Name Color #userlist #messagebuffer.linewrap - input#chatline.form-control(type="text", maxlength="240", style="display: none") + input#chatline.form-control(type="text", maxlength="320", style="display: none") #guestlogin.input-group span.input-group-addon Guest login input#guestname.form-control(type="text", placeholder="Name") diff --git a/www/js/util.js b/www/js/util.js index 895b9b05..6942352a 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -2800,7 +2800,7 @@ function initPm(user) { var buffer = $("
").addClass("pm-buffer linewrap").appendTo(body); $("
").appendTo(body); var input = $("").addClass("form-control pm-input").attr("type", "text") - .attr("maxlength", 240) + .attr("maxlength", 320) .appendTo(body); input.keydown(function (ev) {