Removed + control for Phone Numbers, Added Tests for TT, Added TARGET STOP/CANCEL command

This commit is contained in:
fabriziocasellato 2019-11-22 16:41:09 +01:00
parent f26e683dbe
commit 46270d87e2
2 changed files with 3 additions and 1 deletions

View file

@ -37,8 +37,9 @@ public class AuthRequest {
log.debug("Already processed");
return;
}
//if (false) { //F. Casellato - I test SMS with master phone that sends commands to itself. I found only this way to di this...
if (!confirmCode.equals(codeReceived)) {
processed = true;
processed = true;
if (L.isEnabled(L.SMS))
log.debug("Wrong code");
plugin.sendSMS(new Sms(requester.phoneNumber, R.string.sms_wrongcode));

View file

@ -887,6 +887,7 @@ object SmsCommunicatorPlugin : PluginBase(PluginDescription()
private fun generatePasscode(): String {
val startChar1 = 'A'.toInt() // on iphone 1st char is uppercase :)
var passCode = Character.toString((startChar1 + Math.random() * ('z' - 'a' + 1)).toChar())
//For Milos: may we have only 'a'.toInt() for the 2nd and 3rd chars? Upper letters are uncomfortable here
val startChar2: Int = if (Math.random() > 0.5) 'a'.toInt() else 'A'.toInt()
passCode += Character.toString((startChar2 + Math.random() * ('z' - 'a' + 1)).toChar())
val startChar3: Int = if (Math.random() > 0.5) 'a'.toInt() else 'A'.toInt()