Gentoo Archives: gentoo-commits

From: Alex Legler <a3li@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/ag:master commit in: lib/
Date: Mon, 29 Jun 2015 19:46:15
Message-Id: 1435607094.71ddec6c31a89d7b672f1827a2d87aea10c019f5.a3li@gentoo
1 commit: 71ddec6c31a89d7b672f1827a2d87aea10c019f5
2 Author: Alex Legler <alex <AT> a3li <DOT> li>
3 AuthorDate: Mon Jun 29 19:44:54 2015 +0000
4 Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 29 19:44:54 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/ag.git/commit/?id=71ddec6c
7
8 Fix broken names when no realname is set in From:
9
10 This should avoid further 'Encoding could not be reliably detected'
11 errors for messages with 'From: addr <AT> dom.ain' headers.
12
13 lib/utils.rb | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
15
16 diff --git a/lib/utils.rb b/lib/utils.rb
17 index cc9fd46..e3a4836 100644
18 --- a/lib/utils.rb
19 +++ b/lib/utils.rb
20 @@ -61,7 +61,10 @@ module Ag
21
22 def get_sender_displayname(message)
23 begin
24 - fix_encoding(message[:from].addrs.first.display_name).strip
25 + display_name = message[:from].addrs.first.display_name
26 + display_name ||= message[:from].addrs.first.to_s
27 +
28 + fix_encoding(display_name).strip
29 rescue NoMethodError
30 fix_encoding(message[:from].to_s).strip
31 end