summaryrefslogtreecommitdiffstats
path: root/lib/Plugins
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-19 13:26:08 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-19 13:26:08 +0100
commitc3afe7c8ea7ccb147e30ccbafbfcdad279d479aa (patch)
tree94c39a5d2f45cee562c0529e2ffa22e22a369d8b /lib/Plugins
parent483f24b17ccfa0aaab8dd9d50b3228475d259bcf (diff)
downloadabrt-c3afe7c8ea7ccb147e30ccbafbfcdad279d479aa.tar.gz
abrt-c3afe7c8ea7ccb147e30ccbafbfcdad279d479aa.tar.xz
abrt-c3afe7c8ea7ccb147e30ccbafbfcdad279d479aa.zip
make BZ insert small text attachments inline; move text file detection code
Run-tested Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Plugins')
-rw-r--r--lib/Plugins/Bugzilla.cpp25
-rw-r--r--lib/Plugins/Mailx.cpp1
2 files changed, 11 insertions, 15 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index 7ddacf7..5734238 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -14,13 +14,6 @@
#define XML_RPC_SUFFIX "/xmlrpc.cgi"
-static void create_new_bug_description(const map_crash_report_t& pCrashReport, std::string& pDescription)
-{
- pDescription = "abrt "VERSION" detected a crash.\n\n";
- pDescription += make_description_bz(pCrashReport);
-}
-
-
/*
* Static namespace for xmlrpc stuff.
* Used mainly to ensure we always destroy xmlrpc client and server_info.
@@ -236,8 +229,8 @@ uint32_t ctx::new_bug(const map_crash_report_t& pCrashReport)
std::string summary = "[abrt] crash detected in " + package;
std::string status_whiteboard = "abrt_hash:" + uuid;
- std::string description;
- create_new_bug_description(pCrashReport, description);
+ std::string description = "abrt "VERSION" detected a crash.\n\n";
+ description += make_description_bz(pCrashReport);
std::string product;
std::string version;
@@ -287,15 +280,17 @@ void ctx::add_attachments(const char* bug_id_str, const map_crash_report_t& pCra
map_crash_report_t::const_iterator it = pCrashReport.begin();
for (; it != pCrashReport.end(); it++)
{
- if (it->second[CD_TYPE] == CD_ATT)
+ const std::string &filename = it->first;
+ const std::string &type = it->second[CD_TYPE];
+ const std::string &content = it->second[CD_CONTENT];
+
+ if (type == CD_ATT)
{
- std::string description = "File: " + it->first;
- const std::string& to_encode = it->second[CD_CONTENT];
- char *encoded64 = encode_base64(to_encode.c_str(), to_encode.length());
+ char *encoded64 = encode_base64(content.c_str(), content.length());
xmlrpc_value* param = xmlrpc_build_value(&env,"(s{s:s,s:s,s:s,s:s})",
bug_id_str,
- "description", description.c_str(),
- "filename", it->first.c_str(),
+ "description", ("File: " + filename).c_str(),
+ "filename", filename.c_str(),
"contenttype", "text/plain",
"data", encoded64
);
diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp
index 32eeb25..dc6e2b0 100644
--- a/lib/Plugins/Mailx.cpp
+++ b/lib/Plugins/Mailx.cpp
@@ -90,6 +90,7 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport,
unsigned arg_size = 0;
args = append_str_to_vector(args, arg_size, MAILX_COMMAND);
+//TODO: move email body generation to make_descr.cpp
std::string binaryFiles, commonFiles, bigTextFiles, additionalFiles, UUIDFile;
map_crash_report_t::const_iterator it;
for (it = pCrashReport.begin(); it != pCrashReport.end(); it++)