[Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.34,1.35
Mark Hammond
mhammond@users.sourceforge.net
Sat Nov 23 12:00:06 2002
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv30369
Modified Files:
msgstore.py
Log Message:
PR_CONTENT_UNREAD is documented as optional, and doens't always work with
Exchange stores - so nuke it completely.
Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** msgstore.py 23 Nov 2002 06:45:43 -0000 1.34
--- msgstore.py 23 Nov 2002 12:00:02 -0000 1.35
***************
*** 229,242 ****
else:
message_id = self.NormalizeID(message_id)
! prop_ids = PR_PARENT_ENTRYID, PR_SEARCH_KEY, PR_CONTENT_UNREAD
mapi_object = self._OpenEntry(message_id)
hr, data = mapi_object.GetProps(prop_ids,0)
folder_eid = data[0][1]
searchkey = data[1][1]
! unread = data[2][1]
folder_id = message_id[0], folder_eid
folder = MAPIMsgStoreFolder(self, folder_id,
"Unknown - temp message", -1)
! return MAPIMsgStoreMsg(self, folder, message_id, searchkey, unread)
_MapiTypeMap = {
--- 229,242 ----
else:
message_id = self.NormalizeID(message_id)
! prop_ids = PR_PARENT_ENTRYID, PR_SEARCH_KEY, PR_MESSAGE_FLAGS
mapi_object = self._OpenEntry(message_id)
hr, data = mapi_object.GetProps(prop_ids,0)
folder_eid = data[0][1]
searchkey = data[1][1]
! flags = data[2][1]
folder_id = message_id[0], folder_eid
folder = MAPIMsgStoreFolder(self, folder_id,
"Unknown - temp message", -1)
! return MAPIMsgStoreMsg(self, folder, message_id, searchkey, flags)
_MapiTypeMap = {
***************
*** 289,293 ****
(PR_MESSAGE_CLASS_A, "IPM.Note"))) # with this value
table.Restrict(restriction, 0)
! prop_ids = PR_ENTRYID, PR_SEARCH_KEY, PR_CONTENT_UNREAD
table.SetColumns(prop_ids, 0)
while 1:
--- 289,293 ----
(PR_MESSAGE_CLASS_A, "IPM.Note"))) # with this value
table.Restrict(restriction, 0)
! prop_ids = PR_ENTRYID, PR_SEARCH_KEY, PR_MESSAGE_FLAGS
table.SetColumns(prop_ids, 0)
while 1:
***************
*** 310,317 ****
field_id = PROP_TAG( PT_I4, PROP_ID(resolve_ids[0]))
# Setup the properties we want to read.
! prop_ids = PR_ENTRYID, PR_SEARCH_KEY, PR_CONTENT_UNREAD
table.SetColumns(prop_ids, 0)
# Set up the restriction
! # Need to check message-flags - PR_CONTENT_UNREAD "optional"
prop_restriction = (mapi.RES_BITMASK, # a bitmask restriction
(mapi.BMR_EQZ, # when bit is clear
--- 310,319 ----
field_id = PROP_TAG( PT_I4, PROP_ID(resolve_ids[0]))
# Setup the properties we want to read.
! prop_ids = PR_ENTRYID, PR_SEARCH_KEY, PR_MESSAGE_FLAGS
table.SetColumns(prop_ids, 0)
# Set up the restriction
! # Need to check message-flags
! # (PR_CONTENT_UNREAD is optional, and somewhat unreliable
! # PR_MESSAGE_FLAGS & MSGFLAG_READ is the official way)
prop_restriction = (mapi.RES_BITMASK, # a bitmask restriction
(mapi.BMR_EQZ, # when bit is clear
***************
*** 340,344 ****
class MAPIMsgStoreMsg(MsgStoreMsg):
! def __init__(self, msgstore, folder, entryid, searchkey, unread):
self.folder = folder
self.msgstore = msgstore
--- 342,346 ----
class MAPIMsgStoreMsg(MsgStoreMsg):
! def __init__(self, msgstore, folder, entryid, searchkey, flags):
self.folder = folder
self.msgstore = msgstore
***************
*** 352,356 ****
# Thus, searchkey is the only reliable long-lived message key.
self.searchkey = searchkey
! self.unread = unread
self.dirty = False
--- 354,359 ----
# Thus, searchkey is the only reliable long-lived message key.
self.searchkey = searchkey
! self.flags = flags
! self.unread = flags & MSGFLAG_READ == 0
self.dirty = False
More information about the Spambayes-checkins
mailing list