Browse Source

Adjust iteration of address books and attachments to stay compatible with TB 86 beta.

master
Jörg Knobloch 1 year ago
parent
commit
5024ed3ecb
2 changed files with 5 additions and 6 deletions
  1. +2
    -2
      addon/content/TbContacts.js
  2. +3
    -4
      addon/content/sendMessage.js

+ 2
- 2
addon/content/TbContacts.js View File

@ -2,14 +2,14 @@
var { MailServices } = ChromeUtils.import("resource:///modules/MailServices.jsm");
var { pEp } = ChromeUtils.import("chrome://pEp4Tb/content/modules/pEp.js");
var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
const TbContacts = {
getCardUserIdForEmail(emailAddress) {
// copied from msgHdrViewOverlay.js
const books = MailServices.ab.directories;
let userId = null;
while (books.hasMoreElements()) {
const ab = books.getNext().QueryInterface(Ci.nsIAbDirectory);
for (let ab of fixIterator(books, Ci.nsIAbDirectory)) {
// Thunderbird supports four different types of address book:
// 1) Its own local address book.
// 2) LDAP address book.


+ 3
- 4
addon/content/sendMessage.js View File

@ -104,10 +104,9 @@ function makeSender(compFields) {
return { send() {} };
}
// Terminate body to prevent SMTP error if no attachments follow.
if (!compFields.attachments.hasMoreElements()) {
compFields.body += "\r\n";
}
// Terminate body to prevent SMTP error in case no attachments follow.
// We used to check for attachments, but we can do it unconditionally.
compFields.body += "\r\n";
return {
send() {
console.info(`Sending message from ${compFields.from} to ${compFields.to}`);


Loading…
Cancel
Save