Daniel's Stuff

I write code

Month: April 2008

Microsoft is going to disable WebDav access to Hotmail

Well, it was fun while it lasted, but Microsoft has finally decided to close access to its servers via the WebDav (or HttpMail) protocol.  As my hotmail plugin uses this protocol to communicate with the hotmail servers this means that as of June 30th 2008 my plugin will no longer work 🙁

I am looking into their new protocol called DeltaSync, but from what I can see Microsoft is using some proprietry encryption/compression on message contents, so it might take a little while (if ever) for it to see the light of day.
Thanks to everyone for all the donations and support over the last 5 years or so.
If I manage to figure out the compression then a new plugin supporting Windows Live mail should be fairly easy to create.  I’ll post progress here if there is any 😉

Weird characters in the previous post

Something really strange happened in the previous post.  There were these weird characters appearing in the text.  From what I can see it is WebKit trying to be helpful and create non-breaking spaces.  Unfortunately rather than insert a good old   it is inserting 0xA0 characters.  I’ve just added some code to look for these characters and replace then with  .  It should be interesting to see if it works 😉

WebView woes

I have been working on a little blog posting app for my wife for some time called BlogThing. The first version worked well enough that I released it for download from the Automagic Software site. It used some pretty nasty stuff that iterated over the chunks in an NSAttributedString, and while it worked pretty well I decided I wanted something a little more future proof. To that end I decided to look into using WebView in edit mode. Under 10.4 this worked really nicely. I could drag in imanges, set the fonts and do all sorts of really neat things. Unfortunately under 10.5 dragging and pasting images into the blog posting just stopped working 🙁 and I’ve not had a lot of time to look into it. Tonight I’ve managed to get it working well enough that I think I can finally give it to my wife to play with.

The following is an example of what I’ve had to do to get dragging to work the way I want it do. I really don’t like it though

– (unsigned)webView:(WebView *)sender dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo {

NSPasteboard* pb = [draggingInfo draggingPasteboard];

if([pb availableTypeFromArray: [NSArray arrayWithObject: NSFilenamesPboardType]]) {

// @TODO: this code assumes that any file dragged in is an image! Bad things will probably happen if they aren’t

NSArray* filenames = [pb propertyListForType: NSFilenamesPboardType];

NSMutableString* html = [NSMutableString string];

for(NSString* filename in filenames) {

[html appendFormat: @”<img src=\”%@\”/>”, [[[NSURL alloc] initFileURLWithPath: filename] absoluteString]];

}

[pb declareTypes: [NSArray arrayWithObject: NSHTMLPboardType] owner: self];

[pb setString: html forType: NSHTMLPboardType];

}

return WebDragDestinationActionAny;

}

Incidentally I’m posting this with BlogThing 2.0