[Bps-public-commit] r9546 - in Net-Server-IMAP: lib/Net/Server/IMAP

alexmv at bestpractical.com alexmv at bestpractical.com
Fri Nov 2 17:44:29 EDT 2007


Author: alexmv
Date: Fri Nov  2 17:44:29 2007
New Revision: 9546

Modified:
   Net-Server-IMAP/   (props changed)
   Net-Server-IMAP/lib/Net/Server/IMAP/Message.pm

Log:
 r24341 at zoq-fot-pik:  chmrr | 2007-11-02 17:43:44 -0400
  * Clean up the untagged fetch reporting logic


Modified: Net-Server-IMAP/lib/Net/Server/IMAP/Message.pm
==============================================================================
--- Net-Server-IMAP/lib/Net/Server/IMAP/Message.pm	(original)
+++ Net-Server-IMAP/lib/Net/Server/IMAP/Message.pm	Fri Nov  2 17:44:29 2007
@@ -60,13 +60,14 @@
     my $old  = exists $self->_flags->{$flag};
     $self->_flags->{$flag} = 1;
 
-    unless ($old or @_) {
+    my $changed = not $old;
+    if ($changed and not @_) {
         for my $c (Net::Server::IMAP->concurrent_connections($self->mailbox)) {
             $c->untagged_fetch->{$c->sequence($self)}{FLAGS}++ unless $c->ignore_flags;
         }
     }
     
-    return not $old;
+    return $changed;
 }
 
 sub clear_flag {
@@ -76,13 +77,14 @@
     my $old  = exists $self->_flags->{$flag};
     delete $self->_flags->{$flag};
 
-    if ($old or @_) {
+    my $changed = $old;
+    if ($changed and not @_) {
         for my $c (Net::Server::IMAP->concurrent_connections($self->mailbox)) {
             $c->untagged_fetch->{$c->sequence($self)}{FLAGS}++ unless $c->ignore_flags;
         }
     }
 
-    return $old;
+    return $changed;
 }
 
 sub has_flag {



More information about the Bps-public-commit mailing list