Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1609 from CTemplar/dev
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
The-Hidden-Hand committed Jan 28, 2022
2 parents 8c56a0d + eea555f commit 20b029b
Show file tree
Hide file tree
Showing 12 changed files with 215 additions and 82 deletions.
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "src/assets/theme"]
path = src/assets/theme
url = https://github.com/CTemplar/webclient-themes.git
[submodule "assets/theme"]
path = assets/theme
url = https://github.com/CTemplar/webclient-themes.git
url = https://github.com/CTemplar/webclient-themes.git
1 change: 1 addition & 0 deletions electron-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function createWindow() {
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
allowRunningInsecureContent: serve ? true : false,
Expand Down
30 changes: 27 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ctemplar",
"version": "2.5.63",
"version": "2.5.64",
"license": "Apache",
"main": "electron-main.js",
"description": "Angular webclient (with Linux, macOS and Windows desktop clients) for CTemplar's encrypted email service.",
Expand Down
38 changes: 24 additions & 14 deletions src/app/mail/mail-detail/mail-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,12 +868,17 @@ export class MailDetailComponent implements OnInit, OnDestroy {
newMail.parent = parentId;
newMail.content = this.getMessageHistory(previousMails);
newMail.htmlQuotedMailContent = newMail.content;
newMail.mailbox = this.mailboxes.find(mailbox => allRecipients.has(mailbox.email))?.id;
// Set drafts's mailbox from the list of available mailboxes
// use the mailbox that is part of the current drafts' receivers giving priority to the current mailbox
const selectedMailbox = allRecipients.has(this.currentMailbox.email)
? this.currentMailbox
: this.mailboxes.find(mailbox => allRecipients.has(mailbox.email));
newMail.mailbox = selectedMailbox?.id;
newMail.is_html = mail.is_html;
if (mail.reply_to && mail.reply_to.length > 0) {
newMail.receiver = mail.reply_to;
} else {
let newReceivers;
let newReceivers: Set<string>;
if (mainReply && mail.children?.length > 0) {
// set reciever with it with the reciever and sender of latest child that is not on Trash
if (this.isShowTrashRelatedChildren) {
Expand All @@ -886,10 +891,10 @@ export class MailDetailComponent implements OnInit, OnDestroy {
...mail.children[mail.children.length - 1].cc,
...mail.children[mail.children.length - 1].bcc,
]);
newReceivers.delete(this.currentMailbox?.email);
newReceivers.delete(selectedMailbox?.email);
} else {
// If it is received email from the other, only sender would be set as receiver
newReceivers = [mail.children[mail.children.length - 1].sender];
newReceivers = new Set([mail.children[mail.children.length - 1].sender]);
}
} else {
for (let childIndex = mail.children.length; childIndex > 0; childIndex -= 1) {
Expand All @@ -914,21 +919,22 @@ export class MailDetailComponent implements OnInit, OnDestroy {
...mail.children[childIndex - 1].cc,
...mail.children[childIndex - 1].bcc,
]);
newReceivers.delete(this.currentMailbox?.email);
newReceivers.delete(selectedMailbox?.email);
break;
} else {
newReceivers = [mail.children[childIndex - 1].sender];
newReceivers = new Set([mail.children[childIndex - 1].sender]);
break;
}
}
}
}
} else if (this.mailboxes.some(mailbox => mail.sender === mailbox.email)) {
newReceivers = new Set([...mail.receiver, mail.sender, ...mail.cc, ...mail.bcc]);
newReceivers.delete(this.currentMailbox?.email);
newReceivers.delete(selectedMailbox?.email);
} else {
newReceivers = [mail.sender];
newReceivers = new Set([mail.sender]);
}
newReceivers.delete(selectedMailbox?.email);
newMail.receiver = newReceivers ? [...newReceivers] : [];
}
this.selectedMailToInclude = mail;
Expand All @@ -952,7 +958,6 @@ export class MailDetailComponent implements OnInit, OnDestroy {
parentId: this.mail.id,
content: this.getMessageHistory(previousMails),
htmlQuotedMailContent: this.getMessageHistory(previousMails),
selectedMailbox: this.mailboxes.find(mailbox => mail.receiver.includes(mailbox.email)),
};
let parentId = this.mail.id;
if (!this.isConversationView && this.mail.parent) {
Expand All @@ -962,10 +967,9 @@ export class MailDetailComponent implements OnInit, OnDestroy {
newMail.parent = parentId;
newMail.content = this.getMessageHistory(previousMails);
newMail.htmlQuotedMailContent = newMail.content;
newMail.mailbox = this.mailboxes.find(mailbox => mail.receiver.includes(mailbox.email))?.id;
newMail.is_html = mail.is_html;

let newReceivers;
let newReceivers: Set<string>;
if (mainReply && mail.children?.length > 0) {
// set reciever with it with the reciever and sender of latest child that is not on Trash
if (this.isShowTrashRelatedChildren) {
Expand All @@ -975,7 +979,6 @@ export class MailDetailComponent implements OnInit, OnDestroy {
...mail.children[mail.children.length - 1].cc,
...mail.children[mail.children.length - 1].bcc,
]);
newReceivers.delete(this.currentMailbox?.email);
} else {
for (let childIndex = mail.children.length; childIndex > 0; childIndex -= 1) {
if (
Expand All @@ -989,16 +992,23 @@ export class MailDetailComponent implements OnInit, OnDestroy {
...mail.children[childIndex - 1].cc,
...mail.children[childIndex - 1].bcc,
]);
newReceivers.delete(this.currentMailbox?.email);
break;
}
}
}
} else {
newReceivers = new Set([...mail.receiver, mail.sender, ...mail.cc, ...mail.bcc]);
newReceivers.delete(this.currentMailbox?.email);
}

// Set drafts's mailbox from the list of available mailboxes
// use the mailbox that is part of the current drafts' receivers giving priority to the current mailbox
const selectedMailbox = newReceivers.has(this.currentMailbox.email)
? this.currentMailbox
: this.mailboxes.find(mailbox => newReceivers.has(mailbox.email));
this.composeMailData[mail.id].selectedMailbox = selectedMailbox;
newReceivers.delete(selectedMailbox?.email);
newMail.receiver = newReceivers ? [...newReceivers] : [];
newMail.mailbox = selectedMailbox?.id;

this.selectedMailToInclude = mail;
newMail.last_action = MailAction.REPLY_ALL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,7 @@ textarea:disabled {
::ng-deep pre {
overflow: hidden !important;
}

.mail-label {
white-space: nowrap;
}
Loading

0 comments on commit 20b029b

Please sign in to comment.