fix user_key reset in promode

This commit is contained in:
Mike Schwörer 2018-11-12 15:58:59 +01:00
parent 93ec261dc0
commit b21b159b95
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
4 changed files with 18 additions and 21 deletions

View File

@ -116,7 +116,7 @@ public class SCNApp extends Application implements LifecycleObserver
[X] - perhaps response codes in api (?) [X] - perhaps response codes in api (?)
[ ] - verify recieve [X] - verify recieve
[ ] - test notification channels [ ] - test notification channels

View File

@ -333,7 +333,6 @@ public class ServerCommunication
} }
SCNSettings.inst().user_id = json_int(json, "user_id"); SCNSettings.inst().user_id = json_int(json, "user_id");
SCNSettings.inst().user_key = json_str(json, "user_key");
SCNSettings.inst().quota_curr = json_int(json, "quota"); SCNSettings.inst().quota_curr = json_int(json, "quota");
SCNSettings.inst().quota_max = json_int(json, "quota_max"); SCNSettings.inst().quota_max = json_int(json, "quota_max");
SCNSettings.inst().promode_server = json_bool(json, "is_pro"); SCNSettings.inst().promode_server = json_bool(json, "is_pro");

View File

@ -50,7 +50,7 @@ public class FBMService extends FirebaseMessagingService
NotificationService.inst().showForeground(msg); NotificationService.inst().showForeground(msg);
} }
ServerCommunication.ack(msg); ServerCommunication.ack(SCNSettings.inst().user_id, SCNSettings.inst().user_key, msg);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -46,15 +46,14 @@ if ($ispro)
$stmt->execute(['uid' => $user_id, 'ptk' => $pro_token]); $stmt->execute(['uid' => $user_id, 'ptk' => $pro_token]);
echo json_encode( echo json_encode(
[ [
'success' => true, 'success' => true,
'user_id' => $user_id, 'user_id' => $user_id,
'user_key' => $new_userkey, 'quota' => $data['quota_today'],
'quota' => $data['quota_today'], 'quota_max'=> Statics::quota_max(true),
'quota_max'=> Statics::quota_max(true), 'is_pro' => true,
'is_pro' => true, 'message' => 'user updated'
'message' => 'user updated' ]);
]);
return 0; return 0;
} }
else else
@ -65,14 +64,13 @@ else
$stmt->execute(['uid' => $user_id]); $stmt->execute(['uid' => $user_id]);
echo json_encode( echo json_encode(
[ [
'success' => true, 'success' => true,
'user_id' => $user_id, 'user_id' => $user_id,
'user_key' => $new_userkey, 'quota' => $data['quota_today'],
'quota' => $data['quota_today'], 'quota_max'=> Statics::quota_max(false),
'quota_max'=> Statics::quota_max(false), 'is_pro' => false,
'is_pro' => false, 'message' => 'user updated'
'message' => 'user updated' ]);
]);
return 0; return 0;
} }