added trash box

This commit is contained in:
Sukhamjot Singh 2022-02-19 17:14:58 +05:30
parent 7e9db02882
commit be39e498d7
3 changed files with 34 additions and 1 deletions

View File

@ -10,6 +10,7 @@ const Messages = {
sent: [],
outbox: [],
drafts: [],
trash: [],
load() {
rs.rsJsonApiRequest('/rsMsgs/getMessageSummaries', {}, (data) => {
Messages.all = data.msgList;
@ -25,6 +26,9 @@ const Messages = {
Messages.drafts = Messages.all.filter(
(msg) => (msg.msgflags & util.RS_MSG_BOXMASK) === util.RS_MSG_DRAFTBOX
);
Messages.trash = Messages.all.filter(
(msg) => (msg.msgflags & util.RS_MSG_BOXMASK) === util.RS_MSG_TRASH
);
});
},
};
@ -34,6 +38,7 @@ const sections = {
outbox: require('mail/mail_outbox'),
drafts: require('mail/mail_draftbox'),
sent: require('mail/mail_sentbox'),
trash: require('mail/mail_trashbox'),
};
const tagselect = {
showval: 'Tags',

View File

@ -0,0 +1,27 @@
const m = require('mithril');
const util = require('mail/mail_util');
const Layout = () => {
return {
view: (v) => [
m('.widget', [
m('h3', 'Trash'),
m('hr'),
m(
util.Table,
m(
'tbody',
v.attrs.list.map((msg) =>
m(util.MessageSummary, {
details: msg,
category: 'trash',
})
)
)
),
]),
],
};
};
module.exports = Layout;

View File

@ -7,7 +7,7 @@ const RS_MSG_INBOX = 0x00;
const RS_MSG_SENTBOX = 0x01;
const RS_MSG_OUTBOX = 0x03;
const RS_MSG_DRAFTBOX = 0x05;
const RS_MSG_TRASH = 0x000020;
const RS_MSG_NEW = 0x10;
const RS_MSG_UNREAD_BY_USER = 0x40;
const RS_MSG_STAR = 0x200;
@ -217,4 +217,5 @@ module.exports = {
RS_MSG_NEW,
RS_MSG_UNREAD_BY_USER,
RS_MSG_STAR,
RS_MSG_TRASH,
};