fixed after review.

This commit is contained in:
Lexsus 2020-06-01 19:29:37 +03:00
parent 4af06620fb
commit 94390ca32f

View file

@ -471,15 +471,13 @@ class SmsCommunicatorPlugin @Inject constructor(
loopPlugin.suspendTo(0L) loopPlugin.suspendTo(0L)
sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.smscommunicator_reconnect))) sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.smscommunicator_reconnect)))
rxBus.send(EventRefreshOverview("SMS_PUMP_START")) rxBus.send(EventRefreshOverview("SMS_PUMP_START"))
sp.putBoolean(R.string.key_objectiveusereconnect, true)
loopPlugin.createOfflineEvent(0) loopPlugin.createOfflineEvent(0)
} }
} }
}) })
} }
}) })
} else if (splitted.size == 3) { } else if ((splitted.size == 3) && (splitted[1].equals("DISCONNECT", ignoreCase = true))) {
if (splitted[1].equals("DISCONNECT", ignoreCase = true)) {
var duration = SafeParse.stringToInt(splitted[2]) var duration = SafeParse.stringToInt(splitted[2])
duration = Math.max(0, duration) duration = Math.max(0, duration)
duration = Math.min(120, duration) duration = Math.min(120, duration)
@ -504,12 +502,6 @@ class SmsCommunicatorPlugin @Inject constructor(
sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.wrongformat))) sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.wrongformat)))
return return
} }
} else {
sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.wrongformat)))
return
}
} }
private fun processPROFILE(splitted: Array<String>, receivedSms: Sms) { // load profiles private fun processPROFILE(splitted: Array<String>, receivedSms: Sms) { // load profiles