Refactoring logic of sending messages and missed calls.

parent de11d2d6
......@@ -704,17 +704,25 @@ rfidCodeExists (const String & rfidCode)
void
notifyUsers (const unsigned long delayTimeOfCallRingingDuration, const byte maximumNotificationsPerUser)
{
for (SimpleList<String>::iterator element = getMobiles().begin(); element != getMobiles().end(); ++element)
for (byte i = 0; i < maximumNotificationsPerUser; i++)
{
const String mobile = *element;
for (byte i = 0; i < maximumNotificationsPerUser; i++)
for (SimpleList<String>::iterator element = getMobiles().begin(); element != getMobiles().end(); ++element)
{
getGsm().missedCall(mobile, delayTimeOfCallRingingDuration);
const String mobile = *element;
getGsm().sendSms(mobile, smsText);
}
}
for (byte i = 0; i < maximumNotificationsPerUser; i++)
{
for (SimpleList<String>::iterator element = getMobiles().begin(); element != getMobiles().end(); ++element)
{
const String mobile = *element;
getGsm().missedCall(mobile, delayTimeOfCallRingingDuration);
}
}
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment