FACT++  1.0
int StateMachineSmartFACT::HandleChatMsg ( const EventImp d)
inlineprivate

Definition at line 2142 of file smartfact.cc.

References StateMachineSmartFACT::EventHist::add(), EventImp::GetQoS(), EventImp::GetSize(), EventImp::GetText(), EventImp::GetTime(), Header(), MessageImp::kComment, HTML::kWhite, and StateMachineSmartFACT::EventHist::rget().

Referenced by StateMachineSmartFACT().

2143  {
2144  if (d.GetSize()==0 || d.GetQoS()!=MessageImp::kComment)
2145  return GetCurrentState();
2146 
2147  if (Time()<d.GetTime()+boost::posix_time::minutes(1))
2148  SetAudio("message");
2149 
2150  fChatHist.add(d.GetText(), d.GetTime());
2151 
2152  ostringstream out;
2153  out << setprecision(3);
2154  out << Header(d) << '\n';
2155  out << HTML::kWhite << '\t';
2156  out << "<->" << fChatHist.rget() << "</->";
2157  out << '\n';
2158 
2159  ofstream(fPath+"/chat.data") << out.str();
2160 
2161  return GetCurrentState();
2162  }
int GetCurrentState() const
return the current state of the machine
const char * GetText() const
Definition: EventImp.h:88
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
void add(const string &s, const Time &t=Time())
Definition: smartfact.cc:469
string Header(const Time &d)
Definition: smartfact.cc:603
virtual Time GetTime() const
Definition: EventImp.h:57
static const string kWhite
Definition: smartfact.cc:74
virtual int GetQoS() const
Definition: EventImp.h:58
void SetAudio(const string &name)
Definition: smartfact.cc:615
A comment which is always printed.
Definition: MessageImp.h:22
virtual size_t GetSize() const
Definition: EventImp.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function: