Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

MailSpring源码分析--接口数据格式

查看数: 1435 | 评论数: 5 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2020-10-13 15:50

正文摘要:

本帖最后由 Qter 于 2020-10-13 16:29 编辑 Folder{         "modelClass": "Folder",         "modelJSONs": [{      ...

回复

Qter 发表于 2020-10-16 17:35:29
Qter 发表于 2020-10-13 17:53:31
Messages are a sub-object of threads. The content of a message === immutable (with the
exception being drafts). Mailspring does not support operations such as move || delete on
individual messages; those operations should be performed on the message’s thread.
All messages are part of a thread, even if that thread has only one message.

Qter 发表于 2020-10-13 17:28:34
app\src\global\mailspring-exports.js
const lazyLoadAndRegisterModel = (klassName, path) => {
  lazyLoad(klassName, `flux/models/${path}`);
  DatabaseObjectRegistry.register(klassName, () => exports[klassName]);
};

lazyLoadAndRegisterModel(`File`, 'file');
lazyLoadAndRegisterModel(`Event`, 'event');
lazyLoadAndRegisterModel(`Label`, 'label');
lazyLoadAndRegisterModel(`Folder`, 'folder');
lazyLoadAndRegisterModel(`Thread`, 'thread');
lazyLoadAndRegisterModel(`Account`, 'account');
lazyLoadAndRegisterModel(`Message`, 'message');
lazyLoadAndRegisterModel(`Contact`, 'contact');

Qter 发表于 2020-10-13 17:14:32
Thread
  1. {
  2.         "modelClass": "Thread",
  3.         "modelJSONs": [{
  4.                 "__cls": "Thread",
  5.                 "aid": "b800a344",
  6.                 "attachmentCount": 0,
  7.                 "fmt": 1599356733,
  8.                 "folders": [{
  9.                         "__cls": "Folder",
  10.                         "_refs": 1,
  11.                         "_u": 0,
  12.                         "aid": "b800a344",
  13.                         "id": "Lk12eu8qWXuhFfhNgWQL95A9kY2aTz54ARP64zovM",
  14.                         "path": "INBOX",
  15.                         "role": "inbox",
  16.                         "v": 2
  17.                 }],
  18.                 "gThrId": "",
  19.                 "id": "t:RysRwotYxZtJXTEsVSrzR2fjqRqyUaAPJJfHsSh12",
  20.                 "inAllMail": true,
  21.                 "labels": [],
  22.                 "lmrt": 1599356733,
  23.                 "lmst": 0,
  24.                 "lmt": 1599356733,
  25.                 "participants": [{
  26.                         "email": "15313159857@139.com"
  27.                 }, {
  28.                         "email": "mail139@139.com",
  29.                         "name": "eeeee"
  30.                 }],
  31.                 "searchRowId": 1,
  32.                 "starred": 0,
  33.                 "subject": "tttt",
  34.                 "unread": 0,
  35.                 "v": 3
  36.         }, {
  37.                 "__cls": "Thread",
  38.                 "aid": "b800a344",
  39.                 "attachmentCount": 0,
  40.                 "fmt": 1596073609,
  41.                 "folders": [{
  42.                         "__cls": "Folder",
  43.                         "_refs": 1,
  44.                         "_u": 0,
  45.                         "aid": "b800a344",
  46.                         "id": "Lk12eu8qWXuhFfhNgWQL95A9kY2aTz54ARP64zovM",
  47.                         "path": "INBOX",
  48.                         "role": "inbox",
  49.                         "v": 2
  50.                 }],
  51.                 "gThrId": "",
  52.                 "id": "t:remEPGj5RBNdCbidBnGgEXVsVd6soxEtKjaxrgSpz",
  53.                 "inAllMail": true,
  54.                 "labels": [],
  55.                 "lmrt": 1596073609,
  56.                 "lmst": 0,
  57.                 "lmt": 1596073609,
  58.                 "participants": [{
  59.                         "email": "15313159857@139.com",
  60.                         "name": "15313159857"
  61.                 }, {
  62.                         "email": "2842929645@qq.com",
  63.                         "name": "2842929645@qq.com"
  64.                 }],
  65.                 "searchRowId": 2,
  66.                 "starred": 0,
  67.                 "subject": "sss",
  68.                 "unread": 0,
  69.                 "v": 3
  70.         }, {
  71.                 "__cls": "Thread",
  72.                 "aid": "b800a344",
  73.                 "attachmentCount": 0,
  74.                 "fmt": 1489652566,
  75.                 "folders": [{
  76.                         "__cls": "Folder",
  77.                         "_refs": 1,
  78.                         "_u": 0,
  79.                         "aid": "b800a344",
  80.                         "id": "Lk12eu8qWXuhFfhNgWQL95A9kY2aTz54ARP64zovM",
  81.                         "path": "INBOX",
  82.                         "role": "inbox",
  83.                         "v": 2
  84.                 }],
  85.                 "gThrId": "",
  86.                 "id": "t:ApPwWThvevAeas6teXWX8BxvXAThwGNi5XUgAgXKh",
  87.                 "inAllMail": true,
  88.                 "labels": [],
  89.                 "lmrt": 1489652566,
  90.                 "lmst": 0,
  91.                 "lmt": 1489652566,
  92.                 "participants": [{
  93.                         "email": "15313159857@139.com"
  94.                 }, {
  95.                         "email": "umc_service@139.com",
  96.                         "name": "ttt"
  97.                 }],
  98.                 "searchRowId": 32,
  99.                 "starred": 0,
  100.                 "subject": "sss",
  101.                 "unread": 0,
  102.                 "v": 2
  103.         }],
  104.         "type": "persist"
  105. }
复制代码

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-5-19 06:57 , Processed in 0.058179 second(s), 24 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表