+2007-05-14 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * SoObjects/Mailer/SOGoDraftObject.m ([NSString
+ -asQPSubjectString:encoding]): simplified method.
+ The headers indicates "utf-8" again thank to our fix in
+ sope-mime.
+
+ * SoObjects/SOGo/SOGoObject.m: fail to build if libFoundation is
+ being used.
+
2007-05-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Common/UIxObjectActions.m ([UIxObjectActions
#include <NGExtensions/NSFileManager+Extensions.h>
#include "common.h"
-static NSString *contentTypeValue = @"text/plain; charset=iso-8859-1";
+static NSString *contentTypeValue = @"text/plain; charset=utf-8";
@interface NSString (NGMimeHelpers)
- (NSString *) asQPSubjectString: (NSString *) encoding;
{
NSString *qpString;
- unsigned char *data, *dest;
- unsigned int dataLen, destLen;
+ NSData *subjectData, *destSubjectData;
- dataLen = [self length];
- data = calloc(dataLen, sizeof (unsigned char*));
- [self getCString: (char *) data];
+ subjectData = [self dataUsingEncoding: NSUTF8StringEncoding];
+ destSubjectData = [subjectData dataByEncodingQuotedPrintable];
- destLen = dataLen * 3;
- dest = calloc(dataLen * 3, sizeof (unsigned char*));
- NGEncodeQuotedPrintableMime (data, dataLen, dest, destLen);
+ qpString = [[NSString alloc] initWithData: destSubjectData
+ encoding: NSASCIIStringEncoding];
+ [qpString autorelease];
- qpString = [NSString stringWithFormat: @"=?%@?Q?%s?=", encoding, dest];
-
- free (data);
- free (dest);
-
- return qpString;
+ return [NSString stringWithFormat: @"=?%@?Q?%@?=", encoding, qpString];
}
@end
/* add subject */
if ([(s = [lInfo objectForKey:@"subject"]) length] > 0)
- [map setObject: [s asQPSubjectString: @"iso-8859-1"]
+ [map setObject: [s asQPSubjectString: @"utf-8"]
forKey:@"subject"];
// [map setObject: [s asQPSubjectString: @"utf-8"] forKey:@"subject"];
02111-1307, USA.
*/
+#if LIB_FOUNDATION_LIBRARY
+#error SOGo won't work properly with libFoundation. Please use gnustep-base \
+ instead.
+#endif
+
#import <NGObjWeb/WEClientCapabilities.h>
#import <NGObjWeb/SoObject+SoDAV.h>
#import <NGObjWeb/WOContext.h>
[contact objectForKey: @"cn"],
[contact objectForKey: @"c_email"]];
[response setStatus: 200];
- [response setHeader: @"text/plain; charset=iso-8859-1"
- forKey: @"Content-Type"];
+// [response setHeader: @"text/plain; charset=iso-8859-1"
+// forKey: @"Content-Type"];
[response appendContentString: responseString];
contact = [contacts nextObject];
}
response = [context response];
[response setStatus: 200];
- [response setHeader: @"text/plain; charset=iso-8859-1"
- forKey: @"Content-Type"];
+// [response setHeader: @"text/plain; charset=iso-8859-1"
+// forKey: @"Content-Type"];
[response appendContentString: [self _freeBusyAsText]];
return response;
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>
/></span></div>
</div>
<!-- separator line -->
- <textarea name="content" var:value="text" />
+ <textarea name="text" var:value="text" />
<!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->
</form>
</var:component>
function extractEmailName(mailTo) {
var emailName = "";
- var emailNamere = /(.+)\ </;
- if (emailNamere.test(mailTo)) {
- emailNamere.exec(mailTo);
- emailName = RegExp.$1;
- }
+ var tmpMailTo = mailTo.replace("<", "<");
+ tmpMailTo = tmpMailTo.replace(">", ">");
- return emailName;
+ var emailNamere = /([ ]+)?(.+)\ </;
+ if (emailNamere.test(tmpMailTo)) {
+ emailNamere.exec(tmpMailTo);
+ emailName = RegExp.$2;
+ }
+
+ return emailName;
}
function sanitizeMailTo(dirtyMailTo) {
- var emailName = extractEmailName(dirtyMailTo);
- var email = "" + extractEmailAddress(dirtyMailTo);
-
- var mailto = "";
- if (emailName && emailName.length > 0)
- mailto = emailName + ' <' + email + '>';
- else
- mailto = email;
+ var emailName = extractEmailName(dirtyMailTo);
+ var email = "" + extractEmailAddress(dirtyMailTo);
+
+ var mailto = "";
+ if (emailName && emailName.length > 0)
+ mailto = emailName + ' <' + email + '>';
+ else
+ mailto = email;
- return mailto;
+ return mailto;
}
function openUserFolderSelector(callback, type) {
return w;
}
-function openMailTo(senderMailto) {
- var mailto = sanitizeMailTo(senderMailto);
-
- if (mailto.length > 0)
- openMailComposeWindow(ApplicationBaseURL
- + "/../Mail/compose?mailto=" + mailto);
+function openMailTo(senderMailTo) {
+ var mailto = sanitizeMailTo(senderMailTo);
+ if (mailto.length > 0)
+ openMailComposeWindow(ApplicationBaseURL
+ + "/../Mail/compose?mailto=" + mailto);
return false; /* stop following the link */
}