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
0a4c2ccb
...
0a4c2ccb02e18fc6218bdc975173ac52a7bc6c11
authored
2002-11-14 07:09:13 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mbox_scan0): Compute uids before calling DISPATCH_ADD_MSG.
1 parent
67f7c3a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
28 deletions
mailbox/mbx_mboxscan.c
mailbox/mbx_mboxscan.c
View file @
0a4c2cc
...
...
@@ -549,7 +549,7 @@ mbox_scan0 (mailbox_t mailbox, size_t msgno, size_t *pcount, int do_notif)
size_t
n
=
0
;
stream_t
stream
;
char
**
sfield
=
NULL
;
size_t
min_uid
=
0
;
int
zn
,
isfrom
=
0
;
char
*
temp
;
...
...
@@ -636,8 +636,19 @@ mbox_scan0 (mailbox_t mailbox, size_t msgno, size_t *pcount, int do_notif)
{
mum
->
body_end
=
total
-
n
-
newline
;
mum
->
body_lines
=
--
lines
-
newline
;
if
(
mum
->
uid
<=
min_uid
)
{
mum
->
uid
=
++
min_uid
;
/* Note that modification for when expunging. */
mum
->
attr_flags
|=
MU_ATTRIBUTE_MODIFIED
;
}
else
min_uid
=
mum
->
uid
;
if
(
do_notif
)
DISPATCH_ADD_MSG
(
mailbox
,
mud
);
}
/* Allocate_msgs will initialize mum. */
ALLOCATE_MSGS
(
mailbox
,
mud
);
...
...
@@ -785,6 +796,16 @@ mbox_scan0 (mailbox_t mailbox, size_t msgno, size_t *pcount, int do_notif)
{
mum
->
body_end
=
total
-
newline
;
mum
->
body_lines
=
lines
-
newline
;
if
(
mum
->
uid
<=
min_uid
)
{
mum
->
uid
=
++
min_uid
;
/* Note that modification for when expunging. */
mum
->
attr_flags
|=
MU_ATTRIBUTE_MODIFIED
;
}
else
min_uid
=
mum
->
uid
;
if
(
do_notif
)
DISPATCH_ADD_MSG
(
mailbox
,
mud
);
}
...
...
@@ -805,33 +826,14 @@ mbox_scan0 (mailbox_t mailbox, size_t msgno, size_t *pcount, int do_notif)
mum
->
attr_flags
|=
MU_ATTRIBUTE_MODIFIED
;
}
}
/* Reset the IMAP uids, if necessary. UID according to IMAP RFC is a 32 bit
ascending number for each messages */
{
size_t
uid
;
size_t
ouid
;
size_t
i
;
for
(
uid
=
ouid
=
i
=
0
;
i
<
mud
->
messages_count
;
i
++
)
{
mum
=
mud
->
umessages
[
i
];
uid
=
mum
->
uid
;
if
(
uid
<=
ouid
)
{
uid
=
ouid
+
1
;
mum
->
uid
=
ouid
=
uid
;
/* Note that modification for when expunging. */
mum
->
attr_flags
|=
MU_ATTRIBUTE_MODIFIED
;
}
else
ouid
=
uid
;
}
if
(
mud
->
messages_count
>
0
&&
uid
>=
mud
->
uidnext
)
{
mum
=
mud
->
umessages
[
0
];
mud
->
uidnext
=
uid
+
1
;
mum
->
attr_flags
|=
MU_ATTRIBUTE_MODIFIED
;
}
}
if
(
mud
->
messages_count
>
0
&&
min_uid
>=
mud
->
uidnext
)
{
mum
=
mud
->
umessages
[
0
];
mud
->
uidnext
=
min_uid
+
1
;
mum
->
attr_flags
|=
MU_ATTRIBUTE_MODIFIED
;
}
#ifdef WITH_PTHREAD
pthread_cleanup_pop
(
0
);
#endif
...
...
Please
register
or
sign in
to post a comment