mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 15:10:04 +08:00
42 lines
1.3 KiB
VimL
Vendored
42 lines
1.3 KiB
VimL
Vendored
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
|