Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
e6d644c1
...
e6d644c167da69d70ef622f49a689ad52791e088
authored
2007-11-12 12:39:57 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(maildir_qfetch): Implement quick_get method.
1 parent
631bdce5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletions
libproto/maildir/mbox.c
libproto/maildir/mbox.c
View file @
e6d644c
...
...
@@ -580,7 +580,8 @@ maildir_scan_dir (struct _amd_data *amd, DIR *dir)
}
static
int
maildir_scan0
(
mu_mailbox_t
mailbox
,
size_t
msgno
MU_ARG_UNUSED
,
size_t
*
pcount
,
maildir_scan0
(
mu_mailbox_t
mailbox
,
size_t
msgno
MU_ARG_UNUSED
,
size_t
*
pcount
,
int
do_notify
)
{
struct
_amd_data
*
amd
=
mailbox
->
data
;
...
...
@@ -656,6 +657,31 @@ maildir_scan0 (mu_mailbox_t mailbox, size_t msgno MU_ARG_UNUSED, size_t *pcount,
}
static
int
maildir_qfetch
(
struct
_amd_data
*
amd
,
mu_message_qid_t
qid
)
{
struct
_maildir_message
*
msg
;
char
*
name
=
strrchr
(
qid
,
'/'
);
char
*
p
;
if
(
!
name
)
return
EINVAL
;
msg
=
calloc
(
1
,
sizeof
(
*
msg
));
msg
->
file_name
=
strdup
(
name
);
p
=
strchr
(
msg
->
file_name
,
':'
);
if
(
p
&&
strcmp
(
p
+
1
,
"2,"
)
==
0
)
msg
->
amd_message
.
attr_flags
=
info_to_flags
(
p
+
3
);
else
msg
->
amd_message
.
attr_flags
=
0
;
msg
->
amd_message
.
deleted
=
msg
->
amd_message
.
attr_flags
&
MU_ATTRIBUTE_DELETED
;
msg
->
uid
=
amd
->
next_uid
(
amd
);
_amd_message_insert
(
amd
,
(
struct
_amd_message
*
)
msg
);
return
0
;
}
int
_mailbox_maildir_init
(
mu_mailbox_t
mailbox
)
{
...
...
@@ -672,6 +698,7 @@ _mailbox_maildir_init (mu_mailbox_t mailbox)
amd
->
msg_finish_delivery
=
maildir_msg_finish_delivery
;
amd
->
msg_file_name
=
maildir_message_name
;
amd
->
scan0
=
maildir_scan0
;
amd
->
qfetch
=
maildir_qfetch
;
amd
->
msg_cmp
=
maildir_message_cmp
;
amd
->
message_uid
=
maildir_message_uid
;
amd
->
next_uid
=
maildir_next_uid
;
...
...
Please
register
or
sign in
to post a comment