/[projects]/smsdaemon/plugins/oldSpamPlugin.cpp
ViewVC logotype

Diff of /smsdaemon/plugins/oldSpamPlugin.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 149 by torben, Sun Dec 7 20:58:41 2008 UTC revision 196 by torben, Thu Dec 18 06:53:29 2008 UTC
# Line 2  Line 2 
2  #include "ISmsTransceiver.h"  #include "ISmsTransceiver.h"
3  #include "Sms.h"  #include "Sms.h"
4    
5  #include "util.h"  #include "Util.h"
6  #include "common.h"  #include "Logger.h"
7  #include <sstream>  #include <sstream>
8  #include <stdlib.h>  #include <stdlib.h>
9    
# Line 12  using namespace std; Line 12  using namespace std;
12    
13    
14  SpamPlugin::SpamPlugin()  SpamPlugin::SpamPlugin()
15  : Plugin("spam", "Sends a number of messages to a given phone nr")                  : Plugin("spam", "Sends a number of messages to a given phone nr")
16  {  {
17  }  }
18    
# Line 28  void SpamPlugin::Execute(ISmsTransceiver Line 28  void SpamPlugin::Execute(ISmsTransceiver
28                  modem.SendSms(sms.GetSender(), USAGE, false);                  modem.SendSms(sms.GetSender(), USAGE, false);
29                  return;                  return;
30          }          }
31            
32          vector<string> parts = Util::str_split(cmd," ");          vector<string> parts = Util::str_split(cmd," ");
33    
34    
# Line 42  void SpamPlugin::Execute(ISmsTransceiver Line 42  void SpamPlugin::Execute(ISmsTransceiver
42          unsigned int count = atoi(parts[1].c_str());          unsigned int count = atoi(parts[1].c_str());
43          if (count > 25)          if (count > 25)
44                  count = 25;                  count = 25;
45            
46          ostringstream os;          ostringstream os;
47          os << "Spamming " << nr << " " << count << " times.";          os << "Spamming " << nr << " " << count << " times.";
48          Common::instance()->logMessage(os.str());          Logger::logMessage(os.str());
49    
50          string message;          string message;
51          for (unsigned i=2; i<parts.size(); ++i)          for (unsigned i=2; i<parts.size(); ++i)

Legend:
Removed from v.149  
changed lines
  Added in v.196

  ViewVC Help
Powered by ViewVC 1.1.20