1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 21:00:06 +08:00
SpaceVim/bundle/vim-mail/autoload/mail/client/mailbox.vim

42 lines
1.3 KiB
VimL
Raw Normal View History

2021-10-23 15:34:04 +08:00
let s:mail_box = {}
function! mail#client#mailbox#get(dir)
return get(s:mail_box, a:dir, {})
endfunction
function! mail#client#mailbox#updatedir(id, from, data, subject, dir)
if !has_key(s:mail_box, a:dir)
call extend(s:mail_box, {a:dir :
\ { a:id :
\ {
\ 'from' : a:from,
\ 'subject' : a:subject,
\ 'data' : a:data,
\ },
\ },
\ }
\ )
else
if !has_key(s:mail_box[a:dir], a:id)
call extend(s:mail_box[a:dir],
\ { a:id :
\ {
\ 'from' : a:from,
\ 'subject' : a:subject,
\ 'data' : a:data,
\ },
\ },
\ )
else
call extend(s:mail_box[a:dir][a:id],
\ {
\ 'from' : a:from,
\ 'subject' : a:subject,
\ 'data' : a:data,
\ },
\ )
endif
endif
endfunction