--- Bugzilla.pm.old	2009-05-12 18:28:21.000000000 +0100
+++ Bugzilla.pm	2009-06-27 08:55:20.000000000 +0100
@@ -97,6 +97,15 @@ sub is_version_up_to_2_22 {
     }
 }
 
+sub is_version_up_to_3_00 {
+    my $self = shift;
+
+    if ( $self->{ version_type } eq "up_to_3_00" ) {
+        return 1;
+    } else {
+        return 0;
+    }
+}
 
 
 # There are various ways to talk to Bugzilla. The Bugzilla API as
@@ -213,6 +222,7 @@ sub init_specific {
 
         # Must load the Bugzilla package before any of its functions are used.
         eval "use Bugzilla";
+	eval "use Bugzilla::Constants qw(USAGE_MODE_EMAIL)";
     }
 
     # This is direct modification to bugzilla's internal variables
@@ -371,19 +381,20 @@ sub bug_status_map {
             $status_map->{ $status } = {};
             $status_map->{ $status }->{ name } = $status;
             $status_map->{ $status }->{ accepts_data_as_resolution } = 0;
-            $status_map->{ $status }->{ active } = 0; #Bugzilla::Bug::is_open_state( $status );
+            #$status_map->{ $status }->{ active } = 0; #Bugzilla::Bug::is_open_state( $status );
+	    $status_map->{ $status }->{ active } = Bugzilla::Status::is_open_state( $status );
             $status_map->{ $status }->{ possible_resolution_states } = [];
             $status_map->{ $status }->{ possible_resolutions } = [];
         }
         
         $status_map->{ 'NEW'      }->{ possible_resolution_states } = [ 'ASSIGNED', 'RESOLVED' ];
         
-        $status_map->{ 'ASSIGNED' }->{ active } = 1;
+        #$status_map->{ 'ASSIGNED' }->{ active } = 1;
         $status_map->{ 'ASSIGNED' }->{ accepts_data_as_resolution } = 1;
         # ASSIGNED -> ASSIGNED for reassignment to other user
         $status_map->{ 'ASSIGNED' }->{ possible_resolution_states } = [ 'ASSIGNED', 'RESOLVED' ];
         
-        $status_map->{ 'REOPENED' }->{ active } = 1;
+        #$status_map->{ 'REOPENED' }->{ active } = 1;
         $status_map->{ 'REOPENED' }->{ possible_resolution_states } = [ 'ASSIGNED', 'RESOLVED' ];
         
         # RESOLVED -> RESOLVED for resolution change only
@@ -442,8 +453,14 @@ sub set_version_type {
 	    } else {
 		$self->{ version_type } = $BUGTRACKER_VERSION_NOT_SUPPORTED;
 	    }
-	} elsif ( $major == 3 && $minor == 0 ) {
-	    $self->{version_type} = $BUGTRACKER_VERSION_LATEST;
+	} elsif ( $major == 3 ) {
+	    if ( $minor == 0 ) {
+		$self->{ version_type } = "up_to_3_00";
+	    } elsif ( $minor == 2 ) {
+	    	$self->{version_type} = $BUGTRACKER_VERSION_LATEST;
+	    } else {
+		$self->{ version_type } = $BUGTRACKER_VERSION_NOT_SUPPORTED;
+	    }
 	} else {
 	    $self->{ version_type } = $BUGTRACKER_VERSION_NOT_SUPPORTED;
 	}
@@ -508,7 +525,7 @@ sub integration_add_comment {
 	    # corresponding userid in the database schema
 	    return 1, "Login '$username' could not be converted to an id in Bugzilla. Is username mapping setup correctly in daemon.conf ?\n" ;
 	}
-    } elsif ( $self->is_version_up_to_2_22() || $self->is_version_latest() ) {
+    } elsif ( $self->is_version_up_to_2_22() || $self->is_version_up_to_3_00() ) {
 	# AppendComment was fixed in Bugzilla 2.22. Should use the
 	# native version
 	my $userid = Bugzilla::User::login_to_id( $username );
@@ -521,6 +538,21 @@ sub integration_add_comment {
 	    # corresponding userid in the database schema
 	    return 1, "Login '$username' could not be converted to an id in Bugzilla. Is username mapping setup correctly in daemon.conf ?\n" ;
 	}
+    } elsif ( $self->is_version_latest() ) {
+        #
+	# Bugzilla 3.2.3
+	#
+	
+	Bugzilla->usage_mode(USAGE_MODE_EMAIL);
+
+        my $userid = Bugzilla::User->new( { name => $username } );
+        Bugzilla->set_user($userid);
+
+        my $current_bug = new Bugzilla::Bug( $bugid );
+        $current_bug->add_comment( $comment );
+        $current_bug->update();
+
+        return 0;
     } else {
 	AppendComment( $bugid, $username, $comment );
 	return 0;
