]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1089820: Make use of User.use_markdown() defined in Bug 1059684
authorKoosha KM <koosha.khajeh@gmail.com>
Wed, 5 Nov 2014 15:55:21 +0000 (15:55 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Wed, 5 Nov 2014 15:55:21 +0000 (15:55 +0000)
r=dkl,a=glob

Bugzilla/WebService/Bug.pm

index f50bb6aee36fe86e1fe060dc66d2b56e5c297d4b..de358b1e027426260659f20c04ca95d875c297f0 100644 (file)
@@ -832,7 +832,8 @@ sub add_attachment {
             $comment     = $params->{comment}->{body};
         }
 
-        ThrowUserError('markdown_disabled') if $is_markdown && !_is_markdown_enabled();
+        ThrowUserError('markdown_disabled')
+            if $is_markdown && !Bugzilla->user->use_markdown();
 
         $attachment->bug->add_comment($comment,
             { is_markdown => $is_markdown,
@@ -891,7 +892,8 @@ sub update_attachment {
         $comment     = $comment->{body};
     }
 
-    ThrowUserError('markdown_disabled') if $is_markdown && !_is_markdown_enabled();
+    ThrowUserError('markdown_disabled')
+        if $is_markdown && !$user->use_markdown();
 
     # Update the values
     foreach my $attachment (@attachments) {
@@ -972,7 +974,8 @@ sub add_comment {
         $params->{is_private} = delete $params->{private};
     }
 
-    ThrowUserError('markdown_disabled') if $params->{is_markdown} && !_is_markdown_enabled();
+    ThrowUserError('markdown_disabled')
+        if $params->{is_markdown} && !$user->use_markdown();
 
     # Append comment
     $bug->add_comment($comment, { isprivate   => $params->{is_private},
@@ -1425,14 +1428,6 @@ sub _add_update_tokens {
     }
 }
 
-sub _is_markdown_enabled {
-    my $user = Bugzilla->user;
-
-    return Bugzilla->feature('markdown')
-            && $user->settings->{use_markdown}->{is_enabled}
-            && $user->setting('use_markdown') eq 'on';
-}
-
 1;
 
 __END__