Merge branch 'master' of github.com:NuSkooler/enigma-bbs into 459-activitypub-integration

This commit is contained in:
Bryan Ashby 2023-05-11 08:46:10 -06:00
commit d5a7905225
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
8 changed files with 115 additions and 18 deletions

View File

@ -55,6 +55,8 @@ const helpText = `
|03/|11topic |03<message> |08- |07Set the room topic
|03/|11bbses |08& |03/|11info <id> |08- |07Info about BBS's connected
|03/|11meetups |08- |07Info about MRC MeetUps
|03/|11quote |08- |07Send raw command to server
|03/|11help |08- |07Server-side commands help
---
|03/|11l33t |03<your message> |08- |07l337 5p34k
|03/|11kewl |03<your message> |08- |07BBS KeWL SPeaK
@ -375,6 +377,18 @@ exports.getModule = class mrcModule extends MenuModule {
'|08' + currentTime + '|00 ' + message.body + '|00'
);
}
// Deliver PrivMsg
else if (
message.to_user.toLowerCase() == this.state.alias.toLowerCase()
) {
const currentTime = moment().format(
this.client.currentTheme.helpers.getTimeFormat()
);
this.addMessageToChatLog(
'|08' + currentTime + '|00 ' + message.body + '|00'
);
}
}
this.viewControllers.mrcChat.switchFocus(MciViewIds.mrcChat.inputArea);
@ -540,6 +554,46 @@ exports.getModule = class mrcModule extends MenuModule {
this.sendServerMessage('LIST');
break;
// Allow support for new server commands without change to client
case 'quote':
this.sendServerMessage(`${message.substr(7)}`);
break;
/**
* Process known additional server commands directly
*/
case 'afk':
this.sendServerMessage(`AFK ${message.substr(5)}`);
break;
case 'roomconfig':
this.sendServerMessage(`ROOMCONFIG ${message.substr(12)}`);
break;
case 'roompass':
this.sendServerMessage(`ROOMPASS ${message.substr(12)}`);
break;
case 'status':
this.sendServerMessage(`STATUS ${message.substr(8)}`);
break;
case 'lastseen':
this.sendServerMessage(`LASTSEEN ${message.substr(10)}`);
break;
case 'help':
this.sendServerMessage(`HELP ${message.substr(6)}`);
break;
case 'statistics':
case 'changelog':
case 'listbans':
case 'listmutes':
case 'routing':
this.sendServerMessage(cmd[0].toUpperCase());
break;
case 'quit':
return this.prevMenu();

View File

@ -183,6 +183,8 @@ General Information:
MessageBase: `usage: oputil.js mb <action> [<arguments>]
Actions:
list-confs List conferences and areas
areafix CMD1 CMD2 ... ADDR Sends an AreaFix NetMail
NetMail is sent to supplied address with the supplied command(s). Multi-part commands
@ -195,6 +197,9 @@ Actions:
packet in the directory specified by PATH. The QWK
BBS ID will be obtained by the final component of PATH.
list-confs arguments:
--areas Include areas within each message conference.
import-areas arguments:
--conf CONF_TAG Conference tag in which to import areas
--network NETWORK Network name/key to associate FTN areas

View File

@ -692,6 +692,30 @@ function exportQWKPacket() {
);
}
const listConferences = () => {
initConfigAndDatabases(err => {
if (err) {
return console.error(err.reason ? err.reason : err.message);
}
const { getSortedAvailMessageConferences } = require('../../core/message_area');
const conferences = getSortedAvailMessageConferences(null, { noClient: true });
for (let conf of conferences) {
console.info(`${conf.confTag} - ${conf.conf.name}`);
if (!argv.areas) {
continue;
}
for (let areaTag of Object.keys(conf.conf.areas)) {
console.info(` ${areaTag} - ${conf.conf.areas[areaTag].name}`);
}
}
});
};
function handleMessageBaseCommand() {
function errUsage() {
return printUsageAndSetExitCode(getHelpFor('MessageBase'), ExitCodes.ERROR);
@ -709,6 +733,7 @@ function handleMessageBaseCommand() {
'import-areas': importAreas,
'qwk-dump': dumpQWKPacket,
'qwk-export': exportQWKPacket,
'list-confs': listConferences,
}[action] || errUsage
)();
}

View File

@ -219,7 +219,8 @@ exports.getModule = class MrcModule extends ServerModule {
connectedSockets.forEach(client => {
if (
message.to_user == '' ||
message.to_user == client.username ||
// Fix PrivMSG delivery on case mismatch
message.to_user.toUpperCase() == client.username.toUpperCase() ||
message.to_user == 'CLIENT' ||
message.from_user == client.username ||
message.to_user == 'NOTME'

View File

@ -557,17 +557,24 @@ exports.getModule = class GopherModule extends ServerModule {
this.makeItem(ItemTypes.InfoMessage, `Messages in ${area.name}`),
this.makeItem(ItemTypes.InfoMessage, '(newest first)'),
this.makeItem(ItemTypes.InfoMessage, '-'.repeat(70)),
...msgList.map(msg =>
this.makeItem(
...msgList.map(msg => {
let m;
try {
m = moment(msg.modTimestamp);
} catch (e) {
this.log.warn(
`Error parsing "${msg.modTimestamp}"; expected timestamp: ${e.message}`
);
m = moment();
}
return this.makeItem(
ItemTypes.TextFile,
`${moment(msg.modTimestamp).format(
'YYYY-MM-DD hh:mma'
)}: ${this.shortenSubject(msg.subject)} (${
msg.fromUserName
} to ${msg.toUserName})`,
`${m.format('YYYY-MM-DD hh:mma')}: ${this.shortenSubject(
msg.subject
)} (${msg.fromUserName} to ${msg.toUserName})`,
`/msgarea/${confTag}/${areaTag}/${msg.messageUuid}`
)
),
);
}),
].join('');
this.log.debug({ confTag, areaTag }, 'Gopher serving message list');

View File

@ -8,10 +8,10 @@ const theme = require('./theme.js');
const sysValidate = require('./system_view_validate.js');
const UserProps = require('./user_property.js');
const { getISOTimestampString } = require('./database.js');
const EnigAssert = require('./enigma_assert');
// deps
const async = require('async');
const assert = require('assert');
const _ = require('lodash');
const moment = require('moment');
@ -110,7 +110,10 @@ exports.getModule = class UserConfigModule extends MenuModule {
// Handlers
//
saveChanges: function (formData, extraArgs, cb) {
assert(formData.value.password === formData.value.passwordConfirm);
EnigAssert(formData.value.password === formData.value.passwordConfirm);
// cache a copy of |formData| as changing a theme below can invalidate it
formData = _.clone(formData);
const newProperties = {
[UserProps.RealName]: formData.value.realName,
@ -127,7 +130,7 @@ exports.getModule = class UserConfigModule extends MenuModule {
self.availThemeInfo[formData.value.theme].themeId,
};
// runtime set theme
// Runtime set theme
theme.setClientTheme(self.client, newProperties.theme_id);
// persist all changes

View File

@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.1)
activesupport (7.0.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@ -9,7 +9,7 @@ GEM
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.9)
concurrent-ruby (1.1.10)
cssminify2 (2.0.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
@ -24,7 +24,7 @@ GEM
nokogiri (>= 1.4)
htmlcompressor (0.4.0)
http_parser.rb (0.8.0)
i18n (1.9.1)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (4.2.1)
addressable (~> 2.4)
@ -76,7 +76,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minitest (5.15.0)
minitest (5.17.0)
nokogiri (1.13.6-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
@ -93,7 +93,7 @@ GEM
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tzinfo (2.0.4)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)

View File

@ -332,6 +332,8 @@
chatServers: {
// multi relay chat settings. No need to sign up, just enable it.
// More info: https://bbswiki.bottomlessabyss.net/index.php?title=MRC_Chat_platform
// Make sure to adjust 'prettyBoardName' to your liking in your config before enabling
mrc: {
enabled : false
serverHostname : 'mrc.bottomlessabyss.net'