* this functionality was put to the rhbz_new_bug() function because it
  is a part of new bug creation process

Signed-off-by: Jakub Filak <[email protected]>
---
 src/plugins/rhbz.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
index b4a5a06..7ea9ff6 100644
--- a/src/plugins/rhbz.c
+++ b/src/plugins/rhbz.c
@@ -624,6 +624,9 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t 
*problem_data,
                                                                 
FILENAME_ANALYZER);
     const char *tainted_short = problem_data_get_content_or_NULL(problem_data,
                                                                 
FILENAME_TAINTED_SHORT);
+    const char *comment      = problem_data_get_content_or_NULL(problem_data,
+                                                                
FILENAME_COMMENT);
+
 
     struct strbuf *buf_summary = strbuf_new();
     if (analyzer && strcmp(analyzer, "libreport") == 0)
@@ -660,9 +663,6 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t 
*problem_data,
     }
     else
     {
-        const char *comment      = 
problem_data_get_content_or_NULL(problem_data,
-                                                                
FILENAME_COMMENT);
-
         char *bz_dsc = make_description(problem_data, 
(char**)g_additional_info_files,
                                         CD_TEXT_ATT_SIZE_BZ, 
MAKEDESC_SHOW_MULTILINE | MAKEDESC_WHITELIST);
 
@@ -751,6 +751,14 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t 
*problem_data,
     free(r);
 
     log(_("New bug id: %i"), new_bug_id);
+
+    if (comment && analyzer && strcmp(analyzer, "Kerneloops") == 0)
+    {
+        /* Please, see rhbz#711591, rhbz#795548 and rhbz#846389 */
+        log("Adding comment #1 with user's comment to kernel bug %i", 
new_bug_id);
+        rhbz_add_comment(ax, new_bug_id, comment, 0);
+    }
+
     return new_bug_id;
 }
 
-- 
1.7.11.2

Reply via email to