(feature) Custom base font size for HTML messages

If SOGoMailComposeFontSize is set to zero, we keep the previous
behaviour (no font-size added to the message HTML body).
This commit is contained in:
Francis Lachapelle committed 2016-02-11 17:45:57 -05:00
1 parent e897bb0399
commit 256a64172e
11 files changed
+113 -29

No files matched your search

+18 -1
View File
@@ -629,9 +629,11 @@ static NSArray *infoKeys = nil;
{
NSDictionary *info;
NSException *error;
NSString *fontSize, *content;
NGMimeType *mimeType;
WORequest *request;
SOGoDraftObject *co;
SOGoUserDefaults *ud;
error = nil;
request = [context request];
@@ -649,7 +651,22 @@ static NSArray *infoKeys = nil;
info = [self infoFromRequest];
[co setHeaders: info];
[co setIsHTML: isHTML];
[co setText: (isHTML ? [NSString stringWithFormat: @"<html>%@</html>", text] : text)];;
if (isHTML)
{
// Set a base font size if mail is HTML and user has set a default font-size
ud = [[context activeUser] userDefaults];
fontSize = [ud mailComposeFontSize];
if ([fontSize intValue] > 0)
content = [NSString stringWithFormat: @"<html><span style=\"font-size: %@px;\">%@</span></html>",
fontSize, text];
else
content = [NSString stringWithFormat: @"<html>%@</html>", text];
}
else
{
content = text;
}
[co setText: content];
error = [co storeInfo];
}