public function event_join() { $user = Dog::getUser(); $server = Dog::getServer(); $channel = Dog::getChannel(); $cid = $channel->getID(); if (Dog::isItself() || Dog_Greeting::hasBeenGreeted($user->getID(), $cid) || false === ($greeting = Dog_GreetMsg::getGreetMsg($server, $channel)) || $greeting->isDisabled()) { return; } $message = $greeting->getVar('dgm_msg'); switch ($greeting->getGreetMode()) { case Dog_GreetMsg::MODE_CHAN: $server->sendPRIVMSG($channel->getName(), $user->getName() . ': ' . $message); break; case Dog_GreetMsg::MODE_NOTICE: $server->sendNOTICE($user->getName(), $message); break; case Dog_GreetMsg::MODE_PRIVMSG: $server->sendPRIVMSG($user->getName(), $message); break; default: Dog_Log::error('Invalid type of greeting in ' . __FILE__ . ' line ' . __LINE__ . '!'); return; } Dog_Greeting::markGreeted($user->getID(), $cid); }
<?php # :gizmore!gizmore@localhost PART #sr :"Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is" $msg = Dog::getIRCMsg(); $serv = Dog::getServer(); $user = Dog::setupUser(); $chan_name = $msg->getArg(0); #$quit_msg = $msg->getArg(1); $chan = Dog::setupChannel(); if (!$user instanceof Dog_User) { } elseif (Dog::isItself()) { $serv->removeChannel($chan); } elseif ($chan instanceof Dog_Channel) { $chan->removeUser($user); }