thunderbird-conversations/thunderbird-conversations

Sent messages are not archived

joonis opened this issue · 2 comments

  • Thunderbird version: 115.11.0
  • Thunderbird Conversation version: 4.1.7
  • Operating System: Linux

What did you do?

In a conversation with received and sent messages I clicked on the upper right archive button.

What did you expect to happen?

All messages that are part of the conversation should be moved to the archive folder.

What actually happened?

Only the received messages were moved to the archive folder.

Here is the responsible function:

  archiveConversation() {
    return async (dispatch, getState) => {
      const state = getState();
      let msgs;
      if (state.summary.isInTab || state.summary.prefs.operateOnConversations) {
        msgs = state.messages.msgData.map((msg) => msg.id);
      } else {
        msgs = await browser.messageDisplay.getDisplayedMessages(
          state.summary.tabId
        );
        msgs = msgs.map((m) => m.id);
      }
      browser.messages.archive(msgs).catch(console.error);
    };
  },

https://github.com/thunderbird-conversations/thunderbird-conversations/blob/main/addon/content/reducer/reducerMessages.js#L209

If one of state.summary.isInTab or state.summary.prefs.operateOnConversations evaluated to true, it would work as expected. But this never seems to be the case.

Shouldn't it be done in the same way as it is done for toggleConversationRead():

  toggleConversationRead({ read }) {
    return async (dispatch, getState) => {
      const state = getState().messages;
      for (let msg of state.msgData) {
        browser.messages.update(msg.id, { read }).catch(console.error);
      }
    };
  },

https://github.com/thunderbird-conversations/thunderbird-conversations/blob/main/addon/content/reducer/reducerMessages.js#L201

Fix:

  archiveConversation() {
    return async (dispatch, getState) => {
      const state = getState();
      let msgs = state.messages.msgData.map((msg) => msg.id);
      browser.messages.archive(msgs).catch(console.error);
    };
  },

Well, operateOnConversations seems to be a property. Is it possible to set it somewhere?

Wow, just on the settings page :)