mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-23 15:12:44 +00:00
Fix for bug #3053
Monotone-Parent: 9376aa4657e9b844da0fae6b7a6d6b2d4245426d Monotone-Revision: 04e28af0435c8c97a56e36c8f4f1110b3c578d39 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-10-29T19:23:31 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2008-10-29 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoUser.m ([-userDefaults]): added support for
|
||||
system-wide defaults for ReplyPlacement, SignaturePlacement,
|
||||
MessageForwarding, and MessageCheck.
|
||||
|
||||
2008-10-23 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoMailer.m ([SOGoMailer
|
||||
|
||||
@@ -134,7 +134,6 @@ extern NSString *SOGoWeekStartFirstFullWeek;
|
||||
- (NSDictionary *) primaryIdentity;
|
||||
- (NSMutableDictionary *) defaultIdentity;
|
||||
- (NSString *) messageForwarding;
|
||||
- (NSString *) messageCheck;
|
||||
|
||||
- (NSString *) signature;
|
||||
- (NSString *) replyPlacement;
|
||||
|
||||
@@ -50,6 +50,10 @@ static NSTimeZone *serverTimeZone = nil;
|
||||
static NSString *fallbackIMAP4Server = nil;
|
||||
static BOOL fallbackIsConfigured = NO;
|
||||
static NSString *defaultLanguage = nil;
|
||||
static NSString *defaultReplyPlacement = nil;
|
||||
static NSString *defaultSignaturePlacement = nil;
|
||||
static NSString *defaultMessageForwarding = nil;
|
||||
static NSString *defaultMessageCheck = nil;
|
||||
static NSArray *superUsernames = nil;
|
||||
static NSURL *SOGoProfileURL = nil;
|
||||
// static BOOL acceptAnyUser = NO;
|
||||
@@ -158,6 +162,31 @@ _timeValue (NSString *key)
|
||||
if (!defaultLanguage)
|
||||
ASSIGN (defaultLanguage, @"English");
|
||||
}
|
||||
if (!defaultReplyPlacement)
|
||||
{
|
||||
ASSIGN (defaultReplyPlacement, [ud stringForKey: @"SOGoMailReplyPlacement"]);
|
||||
if (!defaultReplyPlacement)
|
||||
ASSIGN (defaultReplyPlacement, @"below");
|
||||
}
|
||||
if (!defaultSignaturePlacement)
|
||||
{
|
||||
ASSIGN (defaultSignaturePlacement, [ud stringForKey: @"SOGoMailSignaturePlacement"]);
|
||||
if (!defaultSignaturePlacement)
|
||||
ASSIGN (defaultSignaturePlacement, @"below");
|
||||
}
|
||||
if (!defaultMessageForwarding)
|
||||
{
|
||||
ASSIGN (defaultMessageForwarding, [ud stringForKey: @"SOGoMailMessageForwarding"]);
|
||||
if (!defaultMessageForwarding)
|
||||
ASSIGN (defaultMessageForwarding, @"inline");
|
||||
}
|
||||
if (!defaultMessageCheck)
|
||||
{
|
||||
ASSIGN (defaultMessageCheck, [ud stringForKey: @"SOGoMailMessageCheck"]);
|
||||
if (!defaultMessageCheck)
|
||||
ASSIGN (defaultMessageCheck, @"manually");
|
||||
}
|
||||
|
||||
if (!superUsernames)
|
||||
ASSIGN (superUsernames, [ud arrayForKey: @"SOGoSuperUsernames"]);
|
||||
|
||||
@@ -445,10 +474,21 @@ _timeValue (NSString *key)
|
||||
- (NSUserDefaults *) userDefaults
|
||||
{
|
||||
if (!userDefaults)
|
||||
userDefaults
|
||||
= [[SOGoUserDefaults alloc] initWithTableURL: SOGoProfileURL
|
||||
uid: login
|
||||
fieldName: @"c_defaults"];
|
||||
{
|
||||
userDefaults
|
||||
= [[SOGoUserDefaults alloc] initWithTableURL: SOGoProfileURL
|
||||
uid: login
|
||||
fieldName: @"c_defaults"];
|
||||
/* Required parameters for the web interface */
|
||||
if (![[userDefaults stringForKey: @"ReplyPlacement"] length])
|
||||
[userDefaults setObject: defaultReplyPlacement forKey: @"ReplyPlacement"];
|
||||
if (![[userDefaults stringForKey: @"SignaturePlacement"] length])
|
||||
[userDefaults setObject: defaultSignaturePlacement forKey: @"SignaturePlacement"];
|
||||
if (![[userDefaults stringForKey: @"MessageForwarding"] length])
|
||||
[userDefaults setObject: defaultMessageForwarding forKey: @"MessageForwarding"];
|
||||
if (![[userDefaults stringForKey: @"MessageCheck"] length])
|
||||
[userDefaults setObject: defaultMessageCheck forKey: @"MessageCheck"];
|
||||
}
|
||||
|
||||
return userDefaults;
|
||||
}
|
||||
@@ -778,8 +818,6 @@ _timeValue (NSString *key)
|
||||
|
||||
replyPlacement
|
||||
= [[self userDefaults] stringForKey: @"ReplyPlacement"];
|
||||
if (![replyPlacement length])
|
||||
replyPlacement = @"below";
|
||||
|
||||
return replyPlacement;
|
||||
}
|
||||
@@ -790,8 +828,6 @@ _timeValue (NSString *key)
|
||||
|
||||
signaturePlacement
|
||||
= [[self userDefaults] stringForKey: @"SignaturePlacement"];
|
||||
if (![signaturePlacement length])
|
||||
signaturePlacement = @"below";
|
||||
|
||||
return signaturePlacement;
|
||||
}
|
||||
@@ -802,24 +838,10 @@ _timeValue (NSString *key)
|
||||
|
||||
messageForwarding
|
||||
= [[self userDefaults] stringForKey: @"MessageForwarding"];
|
||||
if (![messageForwarding length])
|
||||
messageForwarding = @"inline";
|
||||
|
||||
return messageForwarding;
|
||||
}
|
||||
|
||||
- (NSString *) messageCheck
|
||||
{
|
||||
NSString *messageCheck;
|
||||
|
||||
messageCheck
|
||||
= [[self userDefaults] stringForKey: @"MessageCheck"];
|
||||
if (![messageCheck length])
|
||||
messageCheck = @"manually";
|
||||
|
||||
return messageCheck;
|
||||
}
|
||||
|
||||
/* folders */
|
||||
|
||||
// TODO: those methods should check whether the traversal stack in the context
|
||||
|
||||
@@ -454,7 +454,7 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
|
||||
|
||||
- (NSString *) userMessageCheck
|
||||
{
|
||||
return [user messageCheck];
|
||||
return [userDefaults stringForKey: @"MessageCheck"];
|
||||
}
|
||||
|
||||
- (void) setUserMessageCheck: (NSString *) newMessageCheck
|
||||
@@ -475,7 +475,7 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
|
||||
|
||||
- (NSString *) userMessageForwarding
|
||||
{
|
||||
return [user messageForwarding];
|
||||
return [userDefaults stringForKey: @"MessageForwarding"];
|
||||
}
|
||||
|
||||
- (void) setUserMessageForwarding: (NSString *) newMessageForwarding
|
||||
@@ -513,7 +513,6 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
|
||||
[user saveMailAccounts];
|
||||
}
|
||||
|
||||
/* Modification */
|
||||
- (NSArray *) replyPlacementList
|
||||
{
|
||||
return [NSArray arrayWithObjects: @"above", @"below", nil];
|
||||
@@ -527,7 +526,7 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
|
||||
|
||||
- (NSString *) userReplyPlacement
|
||||
{
|
||||
return [user replyPlacement];
|
||||
return [userDefaults stringForKey: @"ReplyPlacement"];
|
||||
}
|
||||
|
||||
- (void) setUserReplyPlacement: (NSString *) newReplyPlacement
|
||||
@@ -548,14 +547,13 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
|
||||
|
||||
- (NSString *) userSignaturePlacement
|
||||
{
|
||||
return [user signaturePlacement];
|
||||
return [userDefaults stringForKey: @"SignaturePlacement"];
|
||||
}
|
||||
|
||||
- (void) setUserSignaturePlacement: (NSString *) newSignaturePlacement
|
||||
{
|
||||
[userDefaults setObject: newSignaturePlacement forKey: @"SignaturePlacement"];
|
||||
}
|
||||
/* Fin */
|
||||
|
||||
- (id <WOActionResults>) defaultAction
|
||||
{
|
||||
|
||||
@@ -312,16 +312,9 @@ function onTextIEUpdateCursorPos(event) {
|
||||
|
||||
function onTextFirstFocus() {
|
||||
var content = this.getValue();
|
||||
var signaturePlacement = userDefaults["SignaturePlacement"];
|
||||
if ( typeof(signaturePlacement) == "undefined" ) {
|
||||
signaturePlacement = "below";
|
||||
}
|
||||
var replyPlacement = userDefaults["ReplyPlacement"];
|
||||
if ( typeof(replyPlacement) == "undefined" ) {
|
||||
replyPlacement = signaturePlacement;
|
||||
}
|
||||
|
||||
if ( replyPlacement == "above" ) {
|
||||
if (replyPlacement == "above") {
|
||||
this.insertBefore(document.createTextNode("\r\r"), this.lastChild);
|
||||
this.setCaretTo(0);
|
||||
}
|
||||
@@ -554,7 +547,7 @@ function initMailEditor() {
|
||||
if (sigLimit > -1)
|
||||
MailEditor.signatureLength = (textContent.length - sigLimit);
|
||||
}
|
||||
if ( userDefaults["ReplyPlacement"] != "above" ) {
|
||||
if (userDefaults["ReplyPlacement"] != "above") {
|
||||
textarea.scrollTop = textarea.scrollHeight;
|
||||
}
|
||||
textarea.observe("focus", onTextFirstFocus);
|
||||
|
||||
Reference in New Issue
Block a user