--- smsdaemon/plugins/SpamPlugin.cpp 2008/12/07 15:51:02 142 +++ smsdaemon/plugins/oldSpamPlugin.cpp 2010/04/27 21:06:53 678 @@ -1,9 +1,9 @@ #include "SpamPlugin.h" -#include "IGsmModem.h" +#include "ISmsTransceiver.h" #include "Sms.h" -#include "util.h" -#include "common.h" +#include "Util.h" +#include "Logger.h" #include #include @@ -12,13 +12,13 @@ SpamPlugin::SpamPlugin() -: Plugin("spam", "Sends a number of messages to a given phone nr") + : Plugin("spam", "Sends a number of messages to a given phone nr") { } const string USAGE = "Usage: spam message"; -void SpamPlugin::Execute(IGsmModem& modem, SMS& sms) +void SpamPlugin::Execute(ISmsTransceiver& modem, SMS& sms) { string cmd = sms.ExtractParameters(); @@ -28,7 +28,7 @@ modem.SendSms(sms.GetSender(), USAGE, false); return; } - + vector parts = Util::str_split(cmd," "); @@ -42,10 +42,12 @@ unsigned int count = atoi(parts[1].c_str()); if (count > 25) count = 25; - + ostringstream os; os << "Spamming " << nr << " " << count << " times."; - Common::instance()->logMessage(os.str()); + modem.SendSms(sms.GetSender(), os.str(), false); + + Logger::logMessage(os.str()); string message; for (unsigned i=2; i