- (id)init
{
if ( (self = [super init]) ) {
+ _valid = YES;
if (![self requiresPassword]) {
_authenticated = YES;
} else {
- (ITMTRemote *)remote
{
- if (_authenticated) {
+ if (_authenticated && _valid) {
return [[MainController sharedController] currentRemote];
} else {
return nil;
- (BOOL)requiresPassword
{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"enableSharingPassword"];
+ return [[[NSUserDefaults standardUserDefaults] dataForKey:@"sharedPlayerPassword"] length];
}
- (BOOL)sendPassword:(NSData *)password
}
}
+- (void)invalidate
+{
+ _valid = NO;
+}
+
+- (void)makeValid
+{
+ _valid = YES;
+}
+
+- (BOOL)isValid
+{
+ return _valid;
+}
+
@end