Skip to content
Snippets Groups Projects
Commit a0af9812 authored by echicken's avatar echicken :chicken:
Browse files

If user is sysop, send a block-sender button back with the

getMailBody data. Use xjs_eval() to render said button.
Added addTwit method. Nothing fancy, just adds your string to
twitlist.cfg and assumes you were really careful about producing
said string and that it won't destroy the universe.
parent 70c8cdcc
No related branches found
No related tags found
No related merge requests found
require('sbbsdefs.js', 'MSG_DELETE'); require('sbbsdefs.js', 'MSG_DELETE');
require('xjs.js', 'xjs_compile');
load(settings.web_lib + 'mime-decode.js'); load(settings.web_lib + 'mime-decode.js');
function listGroups() { function listGroups() {
...@@ -404,10 +405,25 @@ function getMailBody(number) { ...@@ -404,10 +405,25 @@ function getMailBody(number) {
ret.body = formatMessage(pt_body == body ? decoded.body : pt_body); // See above re: pt_body ret.body = formatMessage(pt_body == body ? decoded.body : pt_body); // See above re: pt_body
ret.inlines = decoded.inlines; ret.inlines = decoded.inlines;
ret.attachments = decoded.attachments; ret.attachments = decoded.attachments;
if (user.is_sysop) {
ret.buttons = [
format(xjs_eval(settings.web_components + 'twit-button.xjs', true), number, number, header.from, header.from_net_addr),
];
}
return ret; return ret;
} }
function addTwit(str) {
const f = new File(system.ctrl_dir + 'twitlist.cfg');
if (!f.open('a')) {
log(LOG_ERR, 'Failed to add ' + str + ' to twitlist');
return;
}
f.writeln(str);
f.close();
}
// Returns the user's signature, or an empty String // Returns the user's signature, or an empty String
function getSignature() { function getSignature() {
var fn = format('%s/user/%04d.sig', system.data_dir, user.number); var fn = format('%s/user/%04d.sig', system.data_dir, user.number);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment