I'm working on bug 9432: Bob edits (but doesn't send) an update to a message he received from Alice, the Who column says "up: Bob" instead of "ed: Bob"....
- Alice sends a message to Bob
- Bob syncs mail and gets it.
- Alice edits the message, and clicks Update.
- Bob syncs mail and gets the update.
(From here on out, we're just looking at Bob's state.)
The "sent" and "updated" flags are set on the message; lastMod is "updated".
toMe is True, fromMe is False.
Bob edits the message.
The flags are "edited", "updated", and "sent"; lastmod is "edited".
toMe and fromMe are both True.
Questions:
- When we set the item to 'edited' again, shouldn't 'sent' and 'updated' be reset?
- If not, I need to figure out how to fix the Who code -- currently, we're showing "up: Bob", instead of "ed: Bob", because it just looks at modifiedFlags, and "updated" wins over "edited".
The byline in the DV is correct: it's showing "Edited: [me]" (with dropdown) because it looks at lastMod, which is edited or queued, and it's a message, and fromMe is True.
Note: Bob then sends the message.
The flags are "updated" and "sent".
CommunicationStatus.addDisplayWhos is where I'd fix things... this is the current code:
def addDisplayWhos(self, whos):
"""
Add tuples to the "whos" list: (priority, "text", source name)
"""
commState = CommunicationStatus.getItemCommState(self.itsItem)
modState = None
lastModifiedBy = self.itsItem.lastModifiedBy
if lastModifiedBy is not None:
lastModifiedBy = unicode(lastModifiedBy)
if commState & CommunicationStatus.UPDATE:
whos.append((1, lastModifiedBy, 'updater'))
elif commState & CommunicationStatus.EDITED:
whos.append((1, lastModifiedBy, 'editor'))
else:
whos.append((1000, lastModifiedBy, 'creator'))
stamp_types = Stamp(self.itsItem).stamp_types
if stamp_types and MailStamp in stamp_types:
msg = MailStamp(self.itsItem)
preferFrom = (commState & CommunicationStatus.OUT) == 0
# [... adds lower-priority choices for toAddress, originators, fromAddress ...]