/[projects]/smsdaemon/Common.cpp
ViewVC logotype

Diff of /smsdaemon/Common.cpp

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

revision 216 by torben, Tue Dec 23 12:09:08 2008 UTC revision 217 by torben, Tue Dec 23 14:20:43 2008 UTC
# Line 142  std::string Common::getStatusMessage() Line 142  std::string Common::getStatusMessage()
142          return out.str();          return out.str();
143  }  }
144    
 void Common::LoadWorker(std::set<std::string>& set, std::string config)  
 {  
         set.clear();  
   
         std::vector<std::string> items = Util::str_split(  
                                                         _configFile->GetValue("smsdaemon",config,""),  
                                                         ",");  
   
         std::ostringstream log;  
         log << "Loaded list '" << config << "': ";  
         for (unsigned i=0; i<items.size(); i++)  
         {  
                 set.insert( Util::str_trim(items[i]) );  
                 log << items[i] << " ";  
         }  
         Logger::logMessage(log.str());  
 }  
   
 void Common::LoadLists()  
 {  
         LoadWorker(_blacklist, "blacklist");  
         LoadWorker(_privileged, "privileged");  
 }  
   
   
 bool Common::IsBlacklisted(const std::string& phone)  
 {  
         std::set<std::string>::iterator it = _blacklist.find(phone);  
         return ( it != _blacklist.end() );  
 }  
   
 bool Common::IsPrivileged(const std::string& phone)  
 {  
         std::set<std::string>::iterator it = _privileged.find(phone);  
         return ( it != _privileged.end() );  
 }  

Legend:
Removed from v.216  
changed lines
  Added in v.217

  ViewVC Help
Powered by ViewVC 1.1.20