Giter Site home page Giter Site logo

roy-orbison / gtrash Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 15 KB

Adds a button and keyboard shortcut in Thunderbird to move messages to the Trash. It completes the "folders as labels" functionality in GMail over IMAP.

Home Page: https://addons.thunderbird.net/thunderbird/addon/gtrash/

License: Mozilla Public License 2.0

JavaScript 100.00%
gmail thunderbird-webextension

gtrash's People

Contributors

roy-orbison avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

gtrash's Issues

Cannot identify trash folder, if in account settings the action for "when I delete a message" is not set to "Move to this folder .. "

GTrash/background.js

Lines 97 to 112 in e9be83b

findTrash: for (let folder of account.folders) {
// in case user set special as IMAP dir
if (folder.type === folderTypeTrash) {
moves[accountId].trash = folder;
break findTrash;
}
// otherwise look in special, folders named like "[Gmail]" and "[Googlemail]"
if (/^\[[^\/]+\]$/.test(folder.name)) {
for (let subFolder of folder.subFolders) {
if (subFolder.type === folderTypeTrash) {
moves[accountId].trash = subFolder;
break findTrash;
}
}
}
}

This block of code tries to find the destination of the move by looking at which folder has the type property set to "trash".

To my surprise, it seems that in Thunderbird (tested on 102.10.1), the outcome of this search depends on the user setting of "When I delete a message" for the account.

If "When I delete a message" is set to "Just mark it as deleted" or "Remove it immediately", none of the folders have .type === "trash". The so-named "Trash" or "Deleted" folders actually won't have a type property at all; they're "just" plain folders. Consequently, the move will not happen.

Only by setting the "When I delete.." action as "Move it to this folder ..." can a .type === "trash" folder be identified. In this case, the action is no different from the "Delete" action.

This kinda defeats the purpose of the extension, which is

to move selected messages to the Trash folder regardless of the mail account's When I delete a message setting.

I wonder if this is a new issue caused by Thunderbird API breaking compatibility? If the type property can only be set to "trash" this way, by tying the property with the underlying action of deletion, it seems we have to fall back to something else, e.g. user preference?

Trashing multiple selected messages stops working

After using the add-on to remove a single message, it may no longer be used to delete multiple messages at once. Disabling and re-enabling the add-on restores the multi-delete functionality.

The cause of this is outside this plugin's control, as far as I can tell. The issue is being tracked on Bugzilla.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.