- Revision
- 16130
- Author
- stearns
- Date
- 2007-12-17 12:24:21 -0800 (Mon, 17 Dec 2007)
Log Message
Fix bug 10933 (Don't change the Who column and Comm Status column when editing sent/recvd messages), r=grant
Modified Paths
Diff
Modified: trunk/chandler/application/Utility.py (16129 => 16130)
--- trunk/chandler/application/Utility.py 2007-12-14 23:46:47 UTC (rev 16129) +++ trunk/chandler/application/Utility.py 2007-12-17 20:24:21 UTC (rev 16130) @@ -34,7 +34,7 @@ # with your name (and some helpful text). The comment's really there just to # cause Subversion to warn you of a conflict when you update, in case someone # else changes it at the same time you do (that's why it's on the same line). -SCHEMA_VERSION = "467" # heikki: tip of the day +SCHEMA_VERSION = "468" # stearns: bug 10933 tweak to displayWho rules logger = None # initialized in initLogging()
Modified: trunk/chandler/parcels/osaf/communicationstatus.py (16129 => 16130)
--- trunk/chandler/parcels/osaf/communicationstatus.py 2007-12-14 23:46:47 UTC (rev 16129) +++ trunk/chandler/parcels/osaf/communicationstatus.py 2007-12-17 20:24:21 UTC (rev 16130) @@ -64,7 +64,8 @@ # (firsttime has this bit unset) # UPDATE = 1 - + # 1 2 4 8 16 32 64 128 256 512 1024 + #0x1 2 4 8 10 20 40 80 100 200 400 UPDATE, OUT, IN, NEITHER, EDITED, SENT, ERROR, QUEUED, DRAFT, NEEDS_REPLY, READ = ( 1<<n for n in xrange(11) ) @@ -90,11 +91,10 @@ if MailStamp in stampTypes: # update: This means either: we have just - # received an update, or it's ready to go - # out as an update + # received an update, or it's been sent before and edited. modification = Modification if (modification.updated == lastMod or - (modification.sent != lastMod and + (modification.edited in modifiedFlags and modification.sent in modifiedFlags)): result |= CommunicationStatus.UPDATE @@ -112,15 +112,21 @@ # sent if lastMod in (modification.sent, modification.updated): result |= CommunicationStatus.SENT - # draft if it's not one of sent/queued/error - if result & (CommunicationStatus.SENT | - CommunicationStatus.QUEUED | - CommunicationStatus.ERROR) == 0: - result |= CommunicationStatus.DRAFT - # edited - if Modification.edited in modifiedFlags: - result |= CommunicationStatus.EDITED + # edited & draft only if it's never been mailed (per bug 10933) + if Modification.edited in modifiedFlags \ + and not Modification.sent in modifiedFlags: + result |= CommunicationStatus.EDITED + else: + # draft if it's not one of sent/queued/error + if result & (CommunicationStatus.SENT | + CommunicationStatus.QUEUED | + CommunicationStatus.ERROR) == 0: + result |= CommunicationStatus.DRAFT + else: + # edited + if Modification.edited in modifiedFlags: + result |= CommunicationStatus.EDITED # needsReply if needsReply: @@ -194,7 +200,12 @@ if isMessage: msg = MailStamp(self.itsItem) - preferFrom = (commState & CommunicationStatus.OUT) == 0 + if getattr(msg, 'dateSent', None) is not None: + # Bug 10933: keep showing the From address for edited messages that + # were previously sent + preferFrom = True + else: + preferFrom = (commState & CommunicationStatus.OUT) == 0 toAddress = getattr(msg, 'toAddress', schema.Nil) toText = u", ".join(x.getLabel() for x in toAddress) whos.append((preferFrom and 4 or 2, toText, 'to'))
Modified: trunk/chandler/parcels/osaf/tests/TestCommunicationStatus.py (16129 => 16130)
--- trunk/chandler/parcels/osaf/tests/TestCommunicationStatus.py 2007-12-14 23:46:47 UTC (rev 16129) +++ trunk/chandler/parcels/osaf/tests/TestCommunicationStatus.py 2007-12-17 20:24:21 UTC (rev 16130) @@ -119,7 +119,7 @@ self.checkStatus(inoutFlags, 'SENT') self.note.changeEditState(Modification.edited) - self.checkStatus(inoutFlags, 'EDITED', 'UPDATE', 'DRAFT') + self.checkStatus(inoutFlags, 'UPDATE', 'DRAFT') # Remove the MailStamp; that should make it no longer a Draft mail.remove() @@ -127,7 +127,7 @@ # Re-add the stamp mail.add() - self.checkStatus(inoutFlags, 'EDITED', 'UPDATE', 'DRAFT') + self.checkStatus(inoutFlags, 'UPDATE', 'DRAFT') # and finally, re-send it self.note.changeEditState(Modification.updated)
_______________________________________________ Commits mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/commits
