class ChannelResponseChannel extends IMChannel {\r
protected $ircChannel;\r
\r
+ /**\r
+ * Construct a ChannelResponseChannel\r
+ *\r
+ * @param IMplugin $imPlugin IMPlugin\r
+ * @param string $ircChannel IRC Channel to reply to\r
+ * @return ChannelResponseChannel\r
+ */\r
public function __construct($imPlugin, $ircChannel) {\r
$this->ircChannel = $ircChannel;\r
parent::__construct($imPlugin);\r
}\r
\r
+ /**\r
+ * Send a message using the plugin\r
+ *\r
+ * @param User $user User\r
+ * @param string $text Message text\r
+ * @return void\r
+ */\r
public function output($user, $text) {\r
$text = $user->nickname.': ['.common_config('site', 'name') . '] ' . $text;\r
$this->imPlugin->send_message($this->ircChannel, $text);\r
public $regregexp = null;
public $transport = 'irc';
- public $whiteList;
- public $fake_irc;
+ protected $whiteList;
+ protected $fake_irc;
/**
* Get the internationalized/translated display name of this IM service
/**
* Normalize a screenname for comparison
*
- * @param string $screenname screenname to normalize
- * @return string an equivalent screenname in normalized form
+ * @param string $screenname Screenname to normalize
+ * @return string An equivalent screenname in normalized form
*/
public function normalize($screenname) {
$screenname = str_replace(" ","", $screenname);
/**
* Validate (ensure the validity of) a screenname
*
- * @param string $screenname screenname to validate
- * @return boolean
+ * @param string $screenname Screenname to validate
+ * @return boolean true if screenname is valid
*/
public function validate($screenname) {
if (preg_match('/\A[a-z0-9\-_]{1,1000}\z/i', $screenname)) {
/*
* Start manager on daemon start
*
+ * @param array &$versions Array to insert manager into
* @return boolean
*/
public function onStartImDaemonIoManagers(&$classes) {
/**
* Get a microid URI for the given screenname
*
- * @param string $screenname
+ * @param string $screenname Screenname
* @return string microid URI
*/
public function microiduri($screenname) {
*
* @param string $screenname Screenname to send to
* @param string $body Text to send
- * @return boolean success value
+ * @return boolean true on success
*/
public function send_message($screenname, $body) {
$lines = explode("\n", $body);
/**
* Accept a queued input message.
*
- * @return true if processing completed, false if message should be reprocessed
+ * @return boolean true if processing completed, false if message should be reprocessed
*/
public function receive_raw_message($data) {
if (strpos($data['source'], '#') === 0) {
return true;
}
+ /**
+ * Helper for handling incoming messages from a channel requiring response
+ * to the channel instead of via PM
+ *
+ * @param string $nick Screenname the message was sent from
+ * @param string $channel Channel the message originated from
+ * @param string $message Message text
+ * @param boolean true on success
+ */
protected function handle_channel_incoming($nick, $channel, $notice_text) {
$user = $this->get_user($nick);
// For common_current_user to work
/**
* Attempt to handle a message from a channel as a command
*
- * @param User $user user the message is from
+ * @param User $user User the message is from
* @param string $channel Channel the message originated from
- * @param string $body message text
+ * @param string $body Message text
* @return boolean true if the message was a command and was executed, false if it was not a command
*/
protected function handle_channel_command($user, $channel, $body) {
* Only sends the confirmation message if the nick is
* registered
*
- * @param string $screenname screenname sending to
- * @param string $code the confirmation code
- * @param User $user user sending to
- * @return boolean success value
+ * @param string $screenname Screenname sending to
+ * @param string $code The confirmation code
+ * @param User $user User sending to
+ * @return boolean true on succes
*/
public function checked_send_confirmation_code($screenname, $code, $user) {
$this->fake_irc->doPrivmsg('NickServ', 'INFO '.$screenname);
/**
* Get plugin information
*
- * @param array $versions array to insert information into
+ * @param array $versions Array to insert information into
* @return void
*/
public function onPluginVersion(&$versions) {
* IRC background connection manager for IRC-using queue handlers,
* allowing them to send outgoing messages on the right connection.
*
- * Input is handled during socket select loop, keepalive pings during idle.
- * Any incoming messages will be handled.
+ * Input is handled during socket select loop, Any incoming messages will be handled.
*
* In a multi-site queuedaemon.php run, one connection will be instantiated
* for each site being handled by the current process that has IRC enabled.
*/
class IrcManager extends ImManager {
- public $conn = null;
- public $regchecks = array();
- public $regchecksLookup = array();
+ protected $conn = null;
+ protected $regchecks = array();
+ protected $regchecksLookup = array();
/**
* Initialize connection to server.
/**
* Process IRC events that have come in over the wire.
*
- * @param resource $socket
+ * @param resource $socket Socket to handle input on
* @return void
*/
public function handleInput($socket) {
/**
* Called via a callback when a message is received
- *
* Passes it back to the queuing system
*
* @param array $data Data
/**
* Send a message using the daemon
*
- * @param $data Message
+ * @param $data Message data
* @return boolean true on success
*/
public function send_raw_message($data) {