diff options
-rw-r--r-- | bugzilla.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bugzilla.rb b/bugzilla.rb index 6d2a288..8d5736a 100644 --- a/bugzilla.rb +++ b/bugzilla.rb @@ -275,6 +275,15 @@ class BugzillaPlugin < Plugin @client = nil end + + EMAIL_REPLACEMENTS = { 'gentoo.org' => 'g.o', 'gentooexperimental.org' => 'ge.org' } + def shrink_email(email) + domain = email.split(/@/)[1] + if EMAIL_REPLACEMENTS.key?(domain) + email.sub!(/@#{domain}$/, '@'+EMAIL_REPLACEMENTS[domain]) + end + return email + end # Return the summary for a given bug. def summary(bugno) @@ -310,13 +319,17 @@ class BugzillaPlugin < Plugin status += ", #{reso[0..3]}" if reso and reso.length > 0 desc = bugxml.get_text("short_desc").to_s.decode_entities + reporter = bugxml.get_text("reporter").to_s + reporter = shrink_email(reporter) + assignee = bugxml.get_text("assigned_to").to_s + assignee = shrink_email(assignee) return "" + "Bug #{bugno}; " + "\"#{desc}\"; " + "#{product_component}; " + "#{status}; " + - "#{bugxml.get_text("reporter")} -> #{bugxml.get_text("assigned_to")}; " + + "#{reporter} -> #{assignee}; " + "#{showbugurl.gsub('@BUGNO@', bugno)}" end |