Fix token sanitization when using gcompatup

This commit is contained in:
greenart7c3 2024-09-04 13:58:55 -03:00
parent b6bb214532
commit 3d61343905
No known key found for this signature in database
GPG Key ID: 885822EED3A26A6D

View File

@ -84,7 +84,7 @@ class PushMessageReceiver : MessagingReceiver() {
endpoint: String, endpoint: String,
instance: String, instance: String,
) { ) {
val sanitizedEndpoint = endpoint.dropLast(5) val sanitizedEndpoint = if (endpoint.endsWith("?up=1")) endpoint.dropLast(5) else endpoint
if (sanitizedEndpoint != pushHandler.getSavedEndpoint()) { if (sanitizedEndpoint != pushHandler.getSavedEndpoint()) {
Log.d(TAG, "New endpoint provided:- $endpoint for Instance: $instance ${pushHandler.getSavedEndpoint()} $sanitizedEndpoint") Log.d(TAG, "New endpoint provided:- $endpoint for Instance: $instance ${pushHandler.getSavedEndpoint()} $sanitizedEndpoint")
pushHandler.setEndpoint(sanitizedEndpoint) pushHandler.setEndpoint(sanitizedEndpoint)