Skip to content

Commit

Permalink
Cleaner determination of from text
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Mar 21, 2014
1 parent 10318d7 commit 33dc972
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions imp/js/smartmobile.js
Expand Up @@ -713,17 +713,11 @@ var ImpMobile = {
tmp ? IMP.text.searchresults : cache.label
);

if (!data.from) {
$('#imp-message-from').text(IMP.text.nofrom);
} else if (data.from.raw) {
$('#imp-message-from').text(data.from.raw);
} else if (data.from.addr[0].g) {
$('#imp-message-from').text(data.from.addr[0].g);
} else if (data.from.addr[0].p) {
$('#imp-message-from').text(data.from.addr[0].p);
} else {
$('#imp-message-from').text(data.from.addr[0].b);
}
$('#imp-message-from').text(
data.from
? (data.from.raw || data.from.addr[0].g || data.from.addr[0].p || data.from.addr[0].b)
: IMP.text.nofrom
);

if (data.atc_label) {
$('#imp-message-atc').show();
Expand Down

0 comments on commit 33dc972

Please sign in to comment.