mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-30 22:46:17 +02:00
* Create bundle filenames to spec
* Better cp437 vs utf8 vs other encoding support * Add some CP437 and related utils
This commit is contained in:
parent
1f1813c14a
commit
8817113364
5 changed files with 191 additions and 25 deletions
|
@ -11,6 +11,9 @@ const {
|
|||
sanitizeString,
|
||||
getISOTimestampString } = require('./database.js');
|
||||
|
||||
const { isCP437Encodable } = require('./cp437util');
|
||||
const { containsNonLatinCodepoints } = require('./string_util');
|
||||
|
||||
const {
|
||||
isAnsi, isFormattedLine,
|
||||
splitTextAtTerms,
|
||||
|
@ -145,6 +148,20 @@ module.exports = class Message {
|
|||
return null !== _.get(this, 'meta.System.remote_from_user', null);
|
||||
}
|
||||
|
||||
isCP437Encodable() {
|
||||
return isCP437Encodable(this.toUserName) &&
|
||||
isCP437Encodable(this.fromUserName) &&
|
||||
isCP437Encodable(this.subject) &&
|
||||
isCP437Encodable(this.message);
|
||||
}
|
||||
|
||||
containsNonLatinCodepoints() {
|
||||
return containsNonLatinCodepoints(this.toUserName) ||
|
||||
containsNonLatinCodepoints(this.fromUserName) ||
|
||||
containsNonLatinCodepoints(this.subject) ||
|
||||
containsNonLatinCodepoints(this.message);
|
||||
}
|
||||
|
||||
/*
|
||||
:TODO: finish me
|
||||
static checkUserHasDeleteRights(user, messageIdOrUuid, cb) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue