Lots more work - Implemented nickname checking

This commit is contained in:
Luke Fitzgerald
2010-07-23 13:33:41 -07:00
parent f818182a37
commit c4640c50d3
10 changed files with 306 additions and 82 deletions

View File

@@ -66,6 +66,27 @@ class Phergie_StatusnetBot extends Phergie_Bot {
$this->getProcessor()->handleEvents();
}
/**
* Close the current connection and reconnect to the server
*
* @return void
*/
public function reconnect() {
$driver = $this->getDriver();
$sockets = $driver->getSockets();
// Close any existing connections
try {
$driver->forceQuit();
} catch (Phergie_Driver_Exception $e){}
try {
$driver->doConnect();
} catch (Phergie_Driver_Exception $e){
$driver->forceQuit();
throw $e;
}
}
/**
* Get the sockets used by the bot
*