mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-25 20:28:54 +00:00
Add mobile version to webmail and improvements
This commit is contained in:
1 parent
7645e8e721
commit
4ea428d585
9 files changed
+327
-27
No files matched your search
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
Copyright (C) 2006-2013 Inverse inc.
|
||||
Copyright (C) 2006-2014 Inverse inc.
|
||||
|
||||
This file is part of SOGo
|
||||
|
||||
@@ -32,8 +31,10 @@
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSTimeZone.h>
|
||||
#import <Foundation/NSUserDefaults.h> /* for locale string constants */
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGObjWeb/WOApplication.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
@@ -59,6 +60,7 @@
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/SOGoUserSettings.h>
|
||||
#import <SOGo/WOResourceManager+SOGo.h>
|
||||
|
||||
#import <UI/Common/WODirectAction+SOGo.h>
|
||||
#import <UI/MailPartViewers/UIxMailSizeFormatter.h>
|
||||
@@ -128,11 +130,20 @@
|
||||
}
|
||||
else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] == 1)
|
||||
{
|
||||
// Yesterday
|
||||
return [self labelForKey: @"Yesterday"];
|
||||
}
|
||||
else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] < 7)
|
||||
{
|
||||
// Same week
|
||||
WOResourceManager *resMgr = [[WOApplication application] resourceManager];
|
||||
NSString *language = [[[context activeUser] userDefaults] language];
|
||||
NSDictionary *locale = [resMgr localeForLanguageNamed: language];
|
||||
return [[locale objectForKey: NSWeekDayNameArray] objectAtIndex: [messageDate dayOfWeek]];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [dateFormatter formattedDate: messageDate];
|
||||
return [dateFormatter shortFormattedDate: messageDate];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,7 +701,7 @@
|
||||
msgsList = [[msgs objectForKey: @"fetch"] objectEnumerator];
|
||||
[self setMessage: [msgsList nextObject]];
|
||||
|
||||
msg = [NSMutableArray arrayWithObjects: @"To", @"hasAttachment", @"isFlagged", @"Subject", @"From", @"isRead", @"Priority", @"Date", @"Size", @"Flags", @"uid", nil];
|
||||
msg = [NSMutableArray arrayWithObjects: @"To", @"hasAttachment", @"isFlagged", @"Subject", @"From", @"isRead", @"Priority", @"RelativeDate", @"Size", @"Flags", @"uid", nil];
|
||||
[headers addObject: msg];
|
||||
while (message)
|
||||
{
|
||||
@@ -748,7 +759,7 @@
|
||||
// Priority
|
||||
[msg addObject: [self messagePriority]];
|
||||
|
||||
// Date
|
||||
// Relative Date
|
||||
msgDate = [self messageDate];
|
||||
if (msgDate == nil)
|
||||
msgDate = @"";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
Copyright (C) 2005-2013 Inverse inc.
|
||||
Copyright (C) 2005-2014 Inverse inc.
|
||||
|
||||
This file is part of SOGo.
|
||||
|
||||
@@ -15,7 +14,7 @@
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with OGo; see the file COPYING. If not, write to the
|
||||
License along with SOGo; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
@@ -194,17 +193,23 @@ static NSString *mailETag = nil;
|
||||
- (NSArray *) formattedAddresses: (NSArray *) theAddresses
|
||||
{
|
||||
NSMutableArray *addresses;
|
||||
NSFormatter *formatter;
|
||||
NGImap4EnvelopeAddress *address;
|
||||
NSMutableDictionary *metaAddress;
|
||||
NSString *name, *address;
|
||||
NGImap4EnvelopeAddress *envelopeAddress;
|
||||
int count, i;
|
||||
|
||||
formatter = [[self context] mailEnvelopeFullAddressFormatter];
|
||||
count = [theAddresses count];
|
||||
addresses = [NSMutableArray arrayWithCapacity: count];
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
address = [theAddresses objectAtIndex: i];
|
||||
[addresses addObject: [formatter stringForObjectValue: address]];
|
||||
envelopeAddress = [theAddresses objectAtIndex: i];
|
||||
address = [envelopeAddress baseEMail];
|
||||
name = [envelopeAddress personalName];
|
||||
metaAddress = [NSMutableDictionary dictionaryWithObject: address forKey: @"address"];
|
||||
if (name)
|
||||
[metaAddress setObject: name forKey: @"name"];
|
||||
|
||||
[addresses addObject: metaAddress];
|
||||
}
|
||||
|
||||
return addresses;
|
||||
|
||||
Reference in new issue
Block a user