Skip to content

Commit

Permalink
Only attach GPGMail version if emit-version is set.
Browse files Browse the repository at this point in the history
[#837 state:fixed assigned:mento milestone:2.5.3]
  • Loading branch information
Mento committed Jan 21, 2016
1 parent ebbf3ef commit 6a17814
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Source/GPGMailBundle.m
Expand Up @@ -57,7 +57,7 @@ @interface GPGMailBundle ()
#pragma mark Constants and global variables

NSString *GPGMailSwizzledMethodPrefix = @"MA";
NSString *GPGMailAgent = @"GPGMail %@";
NSString *GPGMailAgent = @"GPGMail";
NSString *GPGMailKeyringUpdatedNotification = @"GPGMailKeyringUpdatedNotification";
NSString *gpgErrorIdentifier = @"^~::gpgmail-error-code::~^";
static NSString * const kExpiredCheckKey = @"__gme__";
Expand Down Expand Up @@ -499,7 +499,12 @@ + (NSString *)bundleBuildNumber {
}

+ (NSString *)agentHeader {
NSString *header = [NSString stringWithFormat:GPGMailAgent, [(GPGMailBundle *)[GPGMailBundle sharedInstance] version]];
NSString *header;
if ([[GPGOptions sharedOptions] boolForKey:@"emit-version"]) {
header = [NSString stringWithFormat:@"%@ %@", GPGMailAgent, [(GPGMailBundle *)[GPGMailBundle sharedInstance] version]];
} else {
header = @"GPGMail";
}
return header;
}

Expand Down

0 comments on commit 6a17814

Please sign in to comment.