void Client::onReadBody(MessagePtr msg, const error_code& error) { // make sure everything was successful if (!error && msg->decode()) { // list of found messages bool found = false; boost::unique_lock<boost::mutex> slock(mSMutex); for (auto iter = mSent.begin(); iter != mSent.end() && !found; ++iter) { if (!strcmp(iter->c_str(), msg->body())) { found = true; mSent.erase(iter); } } // prints the body if (!found) { printf("%s\n", msg->body()); if(0==strncmp(msg->body(),"/banksy",7)) { printf("%s\n", " .s$$$Ss."); printf("%s\n", " .8, $$$. _. . ..sS$$$$$' ...,.;"); printf("%s\n", "o. ,@.. 88 =.$'$' ' ..sS$$$$$$$$$$$$s. _;''"); printf("%s\n", " @@@.@@@. .88. ` ` ""l. .sS$$.._.sS$$$$$$$$$$$$S'''"); printf("%s\n", " .@@@q@@.8888o. .s$$$$$$$$$$$$$$$$$$$$$'"); printf("%s\n", " .:`@@@@33333. .>$$$$$$$$$$$$$$$$$$$$'"); printf("%s\n", " .: `@@@@333' ..>$$$$$$$$$$$$$$$$$$$'"); printf("%s\n", " : `@@333. `., s$$$$$$$$$$$$$$$$$'"); printf("%s\n", " : `@33 $$ S.s$$$$$$$$$$$$$$$$$'"); printf("%s\n", " .S `Y ..` ,'$' `$$$$$$$$$$$$$$"); printf("%s\n", " $s . ..S$s, . .`$$$$$$$$$$$$."); printf("%s\n", " $s ., ,s ,$$$$,,sS$s.$$$$$$$$$$$$$."); printf("%s\n", " / /$$SsS.s. ..s$$$$$$$$$$$$$$$$$$$$$$$$$."); printf("%s\n", " /`.`$$$$$dN.ssS$$'`$$$$$$$$$$$$$$$$$$$$$$$."); printf("%s\n", " / `$$$$$$$$$' `$$$$$$$$$$$$$$$$$$$$$$."); printf("%s\n", " / | `S$$S$' `$$$$$$$$$$$$$$$$$$$$$$."); printf("%s\n", " / / $$$$$$$$$$$$$$$$$$$$$."); printf("%s\n", " `$$$$$$$$$$$$$$$$$$$$$s."); printf("%s\n", " $$$'' .?T$$$$$$$"); printf("%s\n", " .$' ... ?$$# "); printf("%s\n", " ! -=S$$$$$s"); printf("%s\n", " .! -=s$$' `$=-_ :"); printf("%s\n", " , .$$$' `$, .|"); printf("%s\n", " , .$$$' . ,"); printf("%s\n", " , ..$$$'"); printf("%s\n", " .s$$$' `s ."); printf("%s\n", " . .s$$$$' $s. ..$s"); printf("%s\n", " . .s$$$$' `$s=s$$$"); printf("%s\n", " .$$$$' , $$s"); } } // start listening for the next message listen(); } else // error { printf("Error reading body\n"); kill(); } }