Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HTTPS by default for static URLs #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
<key>SUFeedURL</key>
<string>http://www.facebook.com/fbdesknotify/appcast.php</string>
<string>https://www.facebook.com/fbdesknotify/appcast.php</string>
<key>LSUIElement</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
Expand Down
3 changes: 3 additions & 0 deletions source/application/FacebookNotifierController.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@
NSMutableDictionary* names;
ImageDictionary* profilePics;
ImageDictionary* appIcons;

NSURL* baseURL;
}

@property(retain) NotificationManager* notifications;
@property(retain) MessageManager* messages;
@property(retain) NSMutableDictionary* names;
@property(retain) ImageDictionary* profilePics;
@property(retain) ImageDictionary* appIcons;
@property(copy, nonatomic) NSURL* baseURL;

- (void)invalidate;
- (void)markEverythingSeen;
Expand Down
18 changes: 11 additions & 7 deletions source/application/FacebookNotifierController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (void)updateMenu;

@implementation FacebookNotifierController

@synthesize notifications, messages, names, profilePics, appIcons;
@synthesize notifications, messages, names, profilePics, appIcons, baseURL;

FBConnect* connectSession;

Expand All @@ -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];
Expand Down Expand Up @@ -93,6 +95,8 @@ - (void)dealloc
[profilePics release];
[appIcons release];

[baseURL release];

[super dealloc];
}

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/backend/notifications/FBNotification.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down