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

Diff of /smsdaemon/plugins/TogPlugin.cpp

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

revision 52 by torben, Wed Jun 11 12:15:14 2008 UTC revision 80 by torben, Sun Jun 15 18:57:00 2008 UTC
# Line 7  Line 7 
7  #include <iostream>  #include <iostream>
8  #include <sstream>  #include <sstream>
9    
10    #include "common.h"
11    
12  using namespace std;  using namespace std;
13    
14    
# Line 60  void TogPlugin::Execute(IGsmModem& modem Line 62  void TogPlugin::Execute(IGsmModem& modem
62                    
63          if (data == "")          if (data == "")
64          {          {
65                  modem.SendSms(sms.sender, "Usage: tog <stationskode>\ntog list - liste over stationer");                  modem.SendSms(sms.sender, "Usage: tog <stationskode>\ntog list - liste over stationer", false);
66                  return;                  return;
67          }          }
68    
69          if (data == "list")          if (data == "list")
70          {          {
71                  modem.SendSms(sms.sender, CreateStationList());                  modem.SendSms(sms.sender, CreateStationList(), true);
72                  return;                  return;
73          }          }
74    
# Line 75  void TogPlugin::Execute(IGsmModem& modem Line 77  void TogPlugin::Execute(IGsmModem& modem
77    
78          if (code == "")          if (code == "")
79          {          {
80                  modem.SendSms(sms.sender, "Unknown station");                  modem.SendSms(sms.sender, "Unknown station", false);
81                  return;                  return;
82          }          }
83    
# Line 84  void TogPlugin::Execute(IGsmModem& modem Line 86  void TogPlugin::Execute(IGsmModem& modem
86          {          {
87                  infos = GetTrainInfo( code , "" );                  infos = GetTrainInfo( code , "" );
88          }          }
89          catch(...)          catch(std::exception& e)
90          {          {
91                  modem.SendSms(sms.sender, "Connection timeout");                  modem.SendSms(sms.sender, e.what(), false );
92                  return;                  return;
93          }          }
94    
# Line 102  void TogPlugin::Execute(IGsmModem& modem Line 104  void TogPlugin::Execute(IGsmModem& modem
104                  os << train.note << "\n";                  os << train.note << "\n";
105          }          }
106    
107          modem.SendSms(sms.sender, Util::str_latin2gsm(os.str()));          modem.SendSms(sms.sender, Util::str_latin2gsm(os.str()), true);
108    
109    
110    

Legend:
Removed from v.52  
changed lines
  Added in v.80

  ViewVC Help
Powered by ViewVC 1.1.20