Skip to content

Commit

Permalink
Remove old Modmail Pro module (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
eritbh committed Mar 26, 2024
1 parent 19c2581 commit 0b9957f
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 1,186 deletions.
30 changes: 28 additions & 2 deletions extension/data/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import HistoryButton from './modules/historybutton.js';
import Macros from './modules/macros.js';
import Modbar from './modules/modbar.js';
import ModButton from './modules/modbutton.js';
import ModmailPro from './modules/modmailpro.js';
import ModMatrix from './modules/modmatrix.js';
import ModNotes from './modules/modnotes.jsx';
import NewModmailPro from './modules/newmodmailpro.js';
Expand Down Expand Up @@ -238,6 +237,34 @@ async function doSettingsUpdates () {
await TBStorage.setSettingAsync('NewModMail', 'checkForNewMessages', undefined);
}

// (old) modmail pro removed in v7, RIP old modmail. nuke its settings
if (lastVersion < 70000) {
await Promise.all([
'inboxStyle',
'filteredSubs',
'defaultCollapse',
'noRedModmail',
'highlightNew',
'expandReplies',
'hideInviteSpam',
'autoLoad',
'fadeRecipient',
'subredditColor',
'resThreadedModmail',
'subredditColorSalt',
'customLimit',
'filterBots',
'botsToFilter',
'newTabLinks',
'lastVisited',
'replied',
'threadProcessRate',
'entryProcessRate',
'chunkProcessSize',
'twoPhaseProcessing',
].map(setting => TBStorage.setSettingAsync('ModMail', setting, undefined)));
}

// End: version changes.

// This is a super extra check to make sure the wiki page for settings export really is private.
Expand Down Expand Up @@ -351,7 +378,6 @@ async function doSettingsUpdates () {
Usernotes,
Comment,
NewModmailPro,
ModmailPro,
Macros,
PersonalNotes,
HistoryButton,
Expand Down
18 changes: 1 addition & 17 deletions extension/data/modules/modbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export default new Module({
const modmailCount = await TBStorage.getSettingAsync('Notifier', 'modmailCount', 0);
const newModmailCount = await TBStorage.getSettingAsync('Notifier', 'newModmailCount', 0);
const notifierEnabled = await TBStorage.getSettingAsync('Notifier', 'enabled', true);
const modmailCustomLimit = await TBStorage.getSettingAsync('ModMail', 'customLimit', 0);

const modSubredditsFMod = await TBStorage.getSettingAsync('Notifier', 'modSubredditsFMod', false);
const unmoderatedSubredditsFMod = await TBStorage.getSettingAsync('Notifier', 'unmoderatedSubredditsFMod', false);
Expand Down Expand Up @@ -200,16 +199,6 @@ export default new Module({
// style="display: none;"
// toolbar, this will display all counters, quick links and other settings for the toolbox

// This is here in case notifier is disabled which is where this normally is set.
// Atleast, I think.... - creesch
let modMailUrl = $('#modmail').attr('href') || TBCore.link('/message/moderator/');
if (parseInt(modmailCustomLimit) > 0) {
modMailUrl += `?limit=${modmailCustomLimit}`;
$('#modmail').attr('href', modMailUrl);
$('#tb-modmail').attr('href', modMailUrl);
$('#tb-modmailcount').attr('href', modMailUrl);
}

const modQueueUrl = TBCore.link(
modSubredditsFMod ? '/me/f/mod/about/modqueue/' : `/r/${modSubreddits}/about/modqueue`,
);
Expand All @@ -227,11 +216,9 @@ export default new Module({
TBCore.link('/message/inbox/')
}" class="nohavemail tb-icons" id="tb-mail">${TBui.icons.userInbox}</a>
<a href="${TBCore.link('/message/inbox/')}" id="tb-mailCount"></a>
<a title="modmail" href="${modMailUrl}" id="tb-modmail" class="nohavemail tb-icons">${TBui.icons.oldModmail}</a>
<a href="${modMailUrl}" id="tb-modmailcount"></a>
<a href="${newModmailUrl}" class="nohavemail access-required tb-icons" id="tb-new_modmail" ${
openMailTab ? 'target="_blank"' : ''
}>${TBui.icons.newModmail}</a>
}>${TBui.icons.modmail}</a>
<a href="${newModmailUrl}" id="tb-new-modmailcount" ${openMailTab ? 'target="_blank"' : ''}></a>
<a title="modqueue" href="${modQueueUrl}" id="tb-modqueue" class="tb-icons">${TBui.icons.modqueue}</a>
<a href="${modQueueUrl}" id="tb-queueCount"></a>
Expand Down Expand Up @@ -367,9 +354,6 @@ export default new Module({
TBCore.link(`/r/${this.subreddit}`)
}" target="_blank">/r/${this.subreddit}</a></td>
<td class="tb-my-subreddits-subreddit">
<a title="/r/${this.subreddit} modmail!" target="_blank" href="${
TBCore.link(`/r/${this.subreddit}/message/moderator`)
}" data-type="modmail" data-subreddit="${this.subreddit}" class="tb-icons">${TBui.icons.oldModmail}</a>
<a title="/r/${this.subreddit} modqueue" target="_blank" href="${
TBCore.link(`/r/${this.subreddit}/about/modqueue`)
}" data-type="modqueue" data-subreddit="${this.subreddit}" class="tb-icons">${TBui.icons.modqueue}</a>
Expand Down
Loading

0 comments on commit 0b9957f

Please sign in to comment.