From 734ad44ed63d589fda55f257695e02b71ba80c75 Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Fri, 4 Feb 2011 22:00:36 -0500 Subject: [PATCH 1/3] Use URI scheme from FBConnect (which defaults to https) for most menu links --- .../application/FacebookNotifierController.h | 3 +++ .../application/FacebookNotifierController.m | 18 +++++++++++------- source/backend/notifications/FBNotification.m | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/source/application/FacebookNotifierController.h b/source/application/FacebookNotifierController.h index ab52e42..b730a16 100644 --- a/source/application/FacebookNotifierController.h +++ b/source/application/FacebookNotifierController.h @@ -31,6 +31,8 @@ NSMutableDictionary* names; ImageDictionary* profilePics; ImageDictionary* appIcons; + + NSURL* baseURL; } @property(retain) NotificationManager* notifications; @@ -38,6 +40,7 @@ @property(retain) NSMutableDictionary* names; @property(retain) ImageDictionary* profilePics; @property(retain) ImageDictionary* appIcons; +@property(copy, nonatomic) NSURL* baseURL; - (void)invalidate; - (void)markEverythingSeen; diff --git a/source/application/FacebookNotifierController.m b/source/application/FacebookNotifierController.m index 9cd40aa..a619bf1 100644 --- a/source/application/FacebookNotifierController.m +++ b/source/application/FacebookNotifierController.m @@ -31,7 +31,7 @@ - (void)updateMenu; @implementation FacebookNotifierController -@synthesize notifications, messages, names, profilePics, appIcons; +@synthesize notifications, messages, names, profilePics, appIcons, baseURL; FBConnect* connectSession; @@ -41,6 +41,8 @@ - (id)init if (self) { connectSession = [[FBConnect sessionWithAPIKey:@"4a280b1a1f1e4dae116484d677d7ed25" delegate:self] retain]; + NSString* baseURLString = [NSString stringWithFormat:@"%@://www.facebook.com", [connectSession scheme]]; + [self setBaseURL:[NSURL URLWithString:baseURLString]]; notifications = [[NotificationManager alloc] init]; messages = [[MessageManager alloc] init]; @@ -93,6 +95,8 @@ - (void)dealloc [profilePics release]; [appIcons release]; + [baseURL release]; + [super dealloc]; } @@ -169,7 +173,7 @@ - (void)updateMenu - (IBAction)menuShowNewsFeed:(id)sender { [[NSWorkspace sharedWorkspace] openURL: - [NSURL URLWithString:@"http://www.facebook.com/home.php"]]; + [NSURL URLWithString:@"/home.php" relativeToURL:baseURL]]; } - (IBAction)menuShowProfile:(id)sender @@ -181,13 +185,13 @@ - (IBAction)menuShowProfile:(id)sender - (IBAction)menuShowInbox:(id)sender { [[NSWorkspace sharedWorkspace] openURL: - [NSURL URLWithString:@"http://www.facebook.com/inbox"]]; + [NSURL URLWithString:@"/inbox" relativeToURL:baseURL]]; } - (IBAction)menuComposeMessage:(id)sender { [[NSWorkspace sharedWorkspace] openURL: - [NSURL URLWithString:@"http://www.facebook.com/inbox?compose"]]; + [NSURL URLWithString:@"/inbox?compose" relativeToURL:baseURL]]; } - (IBAction)beginUpdateStatus:(id)sender @@ -224,14 +228,14 @@ - (IBAction)menuShowMessage:(id)sender [message markAsRead]; // load inbox url - NSURL *inboxURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.facebook.com/inbox/?tid=%@", - [message objectForKey:@"thread_id"]]]; + NSURL *inboxURL = [NSURL URLWithString:[NSString stringWithFormat:@"/inbox/?tid=%@", + [message objectForKey:@"thread_id"]] relativeToURL:baseURL]; [[NSWorkspace sharedWorkspace] openURL:inboxURL]; } - (IBAction)menuShowAllNotifications:(id)sender { - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.facebook.com/notifications.php"]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"/notifications.php" relativeToURL:baseURL]]; } - (IBAction)menuMarkAsReadAllNotifications:(id)sender diff --git a/source/backend/notifications/FBNotification.m b/source/backend/notifications/FBNotification.m index 900c6df..9ea4638 100644 --- a/source/backend/notifications/FBNotification.m +++ b/source/backend/notifications/FBNotification.m @@ -80,7 +80,7 @@ - (NSURL*)findActionURL if (![NSString exists:hrefString]) { // fine, use the default notification url - hrefString = @"http://www.facebook.com/notifications.php"; + hrefString = @"https://www.facebook.com/notifications.php"; } if (hrefString) { From eecd28490df3c5144e6dfd5b1c1461952fb97884 Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Fri, 4 Feb 2011 22:12:21 -0500 Subject: [PATCH 2/3] Add README --- README | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..daa4934 --- /dev/null +++ b/README @@ -0,0 +1,8 @@ +Facebook Desktop Notifications for Mac OS X +============================================== + +Adds Notifications to your desktop, alerting you when interesting activity happens on Facebook. + +https://www.facebook.com/notifier + +Note: This software is experimental and has only been tested on Mac OS X 10.5 \ No newline at end of file From 9b60dcaac5874130ed5aa8873e26501ccb68d1e4 Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Fri, 4 Feb 2011 22:56:57 -0500 Subject: [PATCH 3/3] Use HTTPS for updates --- resources/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/Info.plist b/resources/Info.plist index bd6ede6..6189703 100644 --- a/resources/Info.plist +++ b/resources/Info.plist @@ -11,7 +11,7 @@ SUPublicDSAKeyFile dsa_pub.pem SUFeedURL - http://www.facebook.com/fbdesknotify/appcast.php + https://www.facebook.com/fbdesknotify/appcast.php LSUIElement CFBundleDevelopmentRegion