Skip to content

Commit

Permalink
[FIX] correct user in HTTP "topic"
Browse files Browse the repository at this point in the history
  • Loading branch information
ckrey committed Jun 14, 2017
1 parent 4aabd6c commit f32e78f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions OwnTracks/OwnTracks/Settings.m
Original file line number Diff line number Diff line change
Expand Up @@ -911,10 +911,6 @@ + (NSString *)theSubscriptions {
+ (NSString *)theUserId {
int mode = [self intForKey:@"mode"];
switch (mode) {
case CONNECTION_MODE_HTTP:
return @"http";
break;

case CONNECTION_MODE_PUBLIC:
return @"user";
break;
Expand All @@ -923,6 +919,7 @@ + (NSString *)theUserId {
return [self stringForKey:@"user"];
break;

case CONNECTION_MODE_HTTP:
case CONNECTION_MODE_PRIVATE:
default:
return [self stringForKey:@"user_preference"];
Expand Down Expand Up @@ -968,7 +965,6 @@ + (NSString *)theMqttUser {
int mode = [self intForKey:@"mode"];
switch (mode) {
case CONNECTION_MODE_PUBLIC:
case CONNECTION_MODE_HTTP:
case CONNECTION_MODE_WATSON:
return nil;
break;
Expand All @@ -983,6 +979,7 @@ + (NSString *)theMqttUser {
[self theDeviceId]];
break;

case CONNECTION_MODE_HTTP:
case CONNECTION_MODE_PRIVATE:
default:
return [self stringForKey:@"user_preference"];
Expand All @@ -994,7 +991,6 @@ + (NSString *)theMqttPass {
int mode = [self intForKey:@"mode"];
switch (mode) {
case CONNECTION_MODE_PUBLIC:
case CONNECTION_MODE_HTTP:
case CONNECTION_MODE_WATSON:
return nil;
break;
Expand All @@ -1007,6 +1003,7 @@ + (NSString *)theMqttPass {
return [self stringForKey:@"token"];
break;

case CONNECTION_MODE_HTTP:
case CONNECTION_MODE_PRIVATE:
default:
return [self stringForKey:@"pass_preference"];
Expand All @@ -1017,7 +1014,6 @@ + (NSString *)theMqttPass {
+ (BOOL)theMqttAuth {
int mode = [self intForKey:@"mode"];
switch (mode) {
case CONNECTION_MODE_HTTP:
case CONNECTION_MODE_PUBLIC:
case CONNECTION_MODE_WATSON:
return FALSE;
Expand All @@ -1028,6 +1024,7 @@ + (BOOL)theMqttAuth {
return TRUE;
break;

case CONNECTION_MODE_HTTP:
case CONNECTION_MODE_PRIVATE:
default:
return [self boolForKey:@"auth_preference"];
Expand Down

0 comments on commit f32e78f

Please sign in to comment.