add separate limits for CW length
This commit is contained in:
parent
10d3d9f382
commit
01e98c75ab
10 changed files with 91 additions and 9 deletions
|
|
@ -350,9 +350,13 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
data.text = null;
|
||||
}
|
||||
|
||||
const maxCwLength = user.host == null
|
||||
? this.config.maxCwLength
|
||||
: this.config.maxRemoteCwLength;
|
||||
|
||||
if (data.cw) {
|
||||
if (data.cw.length > maxTextLength) {
|
||||
data.cw = data.cw.slice(0, maxTextLength);
|
||||
if (data.cw.length > maxCwLength) {
|
||||
data.cw = data.cw.slice(0, maxCwLength);
|
||||
}
|
||||
data.cw = data.cw.trim();
|
||||
if (data.cw === '') {
|
||||
|
|
|
|||
|
|
@ -380,9 +380,13 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
data.text = null;
|
||||
}
|
||||
|
||||
const maxCwLength = user.host == null
|
||||
? this.config.maxCwLength
|
||||
: this.config.maxRemoteCwLength;
|
||||
|
||||
if (data.cw) {
|
||||
if (data.cw.length > maxTextLength) {
|
||||
data.cw = data.cw.slice(0, maxTextLength);
|
||||
if (data.cw.length > maxCwLength) {
|
||||
data.cw = data.cw.slice(0, maxCwLength);
|
||||
}
|
||||
data.cw = data.cw.trim();
|
||||
if (data.cw === '') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue