Fix 'yes'/'no' toggles, consts for well known conf tags/etc.
This commit is contained in:
parent
2495430fae
commit
f264e4886e
|
@ -907,14 +907,14 @@ module.exports = () => {
|
|||
},
|
||||
},
|
||||
|
||||
activity_pub: {
|
||||
name: 'ActivityPub Shared Inbox',
|
||||
desc: 'Public and shared ActivityPub messages',
|
||||
activitypub_internal: {
|
||||
name: 'ActivityPub',
|
||||
desc: 'Public ActivityPub messages',
|
||||
|
||||
areas: {
|
||||
activitypub_shared: {
|
||||
name: 'ActivityPub sharedInbox',
|
||||
desc: 'Public shared inbox for ActivityPub',
|
||||
name: 'ActivityPub Public',
|
||||
desc: 'Public inbox for ActivityPub',
|
||||
alwaysExportExternal: true,
|
||||
subjectOptional: true,
|
||||
addressFlavor: 'activitypub',
|
||||
|
|
|
@ -11,6 +11,11 @@ const sortAreasOrConfs = require('./conf_area_util.js').sortAreasOrConfs;
|
|||
const UserProps = require('./user_property.js');
|
||||
const StatLog = require('./stat_log.js');
|
||||
const SysProps = require('./system_property.js');
|
||||
const {
|
||||
SystemInternalConfTags,
|
||||
WellKnownConfTags,
|
||||
WellKnownAreaTags,
|
||||
} = require('./message_const');
|
||||
|
||||
// deps
|
||||
const async = require('async');
|
||||
|
@ -93,9 +98,9 @@ function getAvailableMessageConferences(client, options) {
|
|||
|
||||
assert(client || true === options.noClient);
|
||||
|
||||
// perform ACS check per conf & omit system_internal if desired
|
||||
// perform ACS check per conf & omit "System Internal" if desired
|
||||
return _.omitBy(Config().messageConferences, (conf, confTag) => {
|
||||
if (!options.includeSystemInternal && 'system_internal' === confTag) {
|
||||
if (!options.includeSystemInternal && SystemInternalConfTags.includes(confTag)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -178,7 +183,7 @@ function getDefaultMessageConferenceTag(client, disableAcsCheck) {
|
|||
//
|
||||
// It's possible that we end up with nothing here!
|
||||
//
|
||||
// Note that built in 'system_internal' is always ommited here
|
||||
// Note that built in "System Internal" are always omitted here
|
||||
//
|
||||
const config = Config();
|
||||
let defaultConf = _.findKey(config.messageConferences, o => o.default);
|
||||
|
@ -192,7 +197,7 @@ function getDefaultMessageConferenceTag(client, disableAcsCheck) {
|
|||
// just use anything we can
|
||||
defaultConf = _.findKey(config.messageConferences, (conf, confTag) => {
|
||||
return (
|
||||
'system_internal' !== confTag &&
|
||||
!SystemInternalConfTags.includes(confTag) &&
|
||||
(true === disableAcsCheck || client.acs.hasMessageConfRead(conf))
|
||||
);
|
||||
});
|
||||
|
@ -545,7 +550,7 @@ function getNewMessageCountAddressedToUser(client, cb) {
|
|||
areaTags,
|
||||
(areaTag, nextAreaTag) => {
|
||||
getMessageAreaLastReadId(client.user.userId, areaTag, (_, lastMessageId) => {
|
||||
lastMessageId = lastMessageId || 0;
|
||||
lastMessageId = lastMessageId || 0; // eslint-disable-line no-unused-vars
|
||||
getNewMessageCountInAreaForUser(
|
||||
client.user.userId,
|
||||
areaTag,
|
||||
|
@ -847,7 +852,13 @@ function trimMessageAreasScheduledEvent(args, cb) {
|
|||
//
|
||||
const maxExternalSentAgeDays = _.get(
|
||||
Config,
|
||||
'messageConferences.system_internal.areas.private_mail.maxExternalSentAgeDays',
|
||||
[
|
||||
'messageConferences',
|
||||
WellKnownConfTags.SystemInternal,
|
||||
'areas',
|
||||
WellKnownAreaTags.Private,
|
||||
'maxExternalSentAgeDays',
|
||||
],
|
||||
30
|
||||
);
|
||||
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
const WellKnownConfTags = {
|
||||
Invalid: '',
|
||||
SystemInternal: 'system_internal',
|
||||
ActivityPubInternal: 'activitypub_internal',
|
||||
};
|
||||
exports.WellKnownConfTags = WellKnownConfTags;
|
||||
|
||||
exports.SystemInternalConfTags = [
|
||||
WellKnownConfTags.SystemInternal,
|
||||
WellKnownConfTags.ActivityPubInternal,
|
||||
];
|
||||
|
||||
const WellKnownAreaTags = {
|
||||
Invalid: '',
|
||||
Private: 'private_mail',
|
||||
|
|
|
@ -11,6 +11,7 @@ const FileBaseFilters = require('./file_base_filter.js');
|
|||
const Errors = require('./enig_error.js').Errors;
|
||||
const { getAvailableFileAreaTags } = require('./file_base_area.js');
|
||||
const { valueAsArray } = require('./misc_util.js');
|
||||
const { SystemInternalConfTags } = require('./message_const');
|
||||
|
||||
// deps
|
||||
const _ = require('lodash');
|
||||
|
@ -80,12 +81,12 @@ exports.getModule = class NewScanModule extends MenuModule {
|
|||
);
|
||||
|
||||
//
|
||||
// Sort conferences by name, other than 'system_internal' which should
|
||||
// Sort conferences by name, other than "System Internal" which should
|
||||
// always come first such that we display private mails/etc. before
|
||||
// other conferences & areas
|
||||
//
|
||||
this.sortedMessageConfs.sort((a, b) => {
|
||||
if ('system_internal' === a.confTag) {
|
||||
if (SystemInternalConfTags.includes(a.confTag)) {
|
||||
return -1;
|
||||
} else {
|
||||
return a.conf.name.localeCompare(b.conf.name, {
|
||||
|
|
|
@ -78,17 +78,17 @@ ToggleMenuView.prototype.setFocusItemIndex = function (index) {
|
|||
};
|
||||
|
||||
ToggleMenuView.prototype.setTrue = function () {
|
||||
this.setFocusItemIndex(0);
|
||||
this.updateSelection();
|
||||
};
|
||||
|
||||
ToggleMenuView.prototype.setFalse = function () {
|
||||
this.setFocusItemIndex(1);
|
||||
this.updateSelection();
|
||||
};
|
||||
|
||||
ToggleMenuView.prototype.setFalse = function () {
|
||||
this.setFocusItemIndex(0);
|
||||
this.updateSelection();
|
||||
};
|
||||
|
||||
ToggleMenuView.prototype.isTrue = function () {
|
||||
return this.focusedItemIndex === 0;
|
||||
return this.focusedItemIndex === 1;
|
||||
};
|
||||
|
||||
ToggleMenuView.prototype.setFromBoolean = function (bool) {
|
||||
|
|
|
@ -87,19 +87,19 @@
|
|||
mci: {
|
||||
TM1: {
|
||||
focus: true
|
||||
items: ["yes", "no"]
|
||||
items: ["no", "yes"]
|
||||
argName: enabled
|
||||
}
|
||||
TM2: {
|
||||
items: ["yes", "no"]
|
||||
items: ["no", "yes"]
|
||||
argName: manuallyApproveFollowers
|
||||
}
|
||||
TM3: {
|
||||
items: ["yes", "no"]
|
||||
items: ["no", "yes"]
|
||||
argName: hideSocialGraph
|
||||
}
|
||||
TM4: {
|
||||
items: ["yes", "no"]
|
||||
items: ["no", "yes"]
|
||||
argName: showRealName
|
||||
}
|
||||
TL5: {argName: "image"}
|
||||
|
|
Loading…
Reference in New Issue