X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/da05d51282a00722e05f2c777db5cc3d0623d348..253524554e56b8bbc06707079e887dbebc20afb6:/NetworkObject.m?ds=inline diff --git a/NetworkObject.m b/NetworkObject.m index 32bbbc8..8721e98 100755 --- a/NetworkObject.m +++ b/NetworkObject.m @@ -24,6 +24,7 @@ - (id)init { if ( (self = [super init]) ) { + _valid = YES; if (![self requiresPassword]) { _authenticated = YES; } else { @@ -35,10 +36,11 @@ - (ITMTRemote *)remote { - if (_authenticated) + if (_authenticated && _valid) { return [[MainController sharedController] currentRemote]; - else + } else { return nil; + } } - (NSString *)serverName @@ -51,7 +53,7 @@ - (BOOL)requiresPassword { - return [[NSUserDefaults standardUserDefaults] boolForKey:@"enableSharingPassword"]; + return ([[[NSUserDefaults standardUserDefaults] dataForKey:@"sharedPlayerPassword"] length] > 0); } - (BOOL)sendPassword:(NSData *)password @@ -65,4 +67,19 @@ } } +- (void)invalidate +{ + _valid = NO; +} + +- (void)makeValid +{ + _valid = YES; +} + +- (BOOL)isValid +{ + return _valid; +} + @end