/head: changeset 122

Optimized folder/IMAP.py addmessagesflags() with new listjoin() in
imaputil. Now, send the server 1:5,7 instead of 1,2,3,4,5,7.
This commit is contained in:
jgoerzen
2002-07-16 02:46:21 +01:00
parent 289412c435
commit 09cf911d53
3 changed files with 40 additions and 1 deletions

View File

@ -66,6 +66,8 @@ class IMAPFolder(BaseFolder):
return
# Now, get the flags and UIDs for these.
# We could conceivably get rid of maxmsgid and just say
# '1:*' here.
response = imapobj.fetch('1:%d' % maxmsgid, '(FLAGS UID)')[1]
finally:
self.imapserver.releaseconnection(imapobj)
@ -146,7 +148,7 @@ class IMAPFolder(BaseFolder):
try:
imapobj.select(self.getfullname())
r = imapobj.uid('store',
','.join([str(uid) for uid in uidlist]),
imaputil.listjoin(uidlist),
'+FLAGS',
imaputil.flagsmaildir2imap(flags))
assert r[0] == 'OK', 'Error with store: ' + r[1]