The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download | Blog | Stats
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

cmd_quit Class Reference

Handle /QUIT. More...

#include <cmd_quit.h>

Inheritance diagram for cmd_quit:

Inheritance graph
[legend]
Collaboration diagram for cmd_quit:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 cmd_quit (InspIRCd *Instance)
 Constructor for quit.
CmdResult Handle (const char **parameters, int pcnt, userrec *user)
 Handle command.

Detailed Description

Handle /QUIT.

These command handlers can be reloaded by the core, and handle basic RFC1459 commands. Commands within modules work the same way, however, they can be fully unloaded, where these may not.

Definition at line 27 of file cmd_quit.h.


Constructor & Destructor Documentation

cmd_quit::cmd_quit InspIRCd Instance  )  [inline]
 

Constructor for quit.

Definition at line 32 of file cmd_quit.h.

References command_t::syntax.

00032 : command_t(Instance,"QUIT",0,0,true) { syntax = "[<message>]"; }


Member Function Documentation

CmdResult cmd_quit::Handle const char **  parameters,
int  pcnt,
userrec user
[virtual]
 

Handle command.

Parameters:
parameters The parameters to the comamnd
pcnt The number of parameters passed to teh command
user The user issuing the command
Returns:
A value from CmdResult to indicate command success or failure.

Implements command_t.

Definition at line 27 of file cmd_quit.cpp.

References CMD_SUCCESS, InspIRCd::Config, ServerConfig::FixedQuit, IS_LOCAL, ServerConfig::PrefixQuit, userrec::QuitUser(), command_t::ServerInstance, and ServerConfig::SuffixQuit.

00028 {
00029 
00030         std::string quitmsg;
00031 
00032         if (IS_LOCAL(user))
00033         {
00034                 if (*ServerInstance->Config->FixedQuit)
00035                         quitmsg = ServerInstance->Config->FixedQuit;
00036                 else
00037                         quitmsg = pcnt ?
00038                                 ServerInstance->Config->PrefixQuit + std::string(parameters[0]) + ServerInstance->Config->SuffixQuit
00039                                 : "Client exited";
00040         }
00041         else
00042                 quitmsg = pcnt ? parameters[0] : "Client exited";
00043 
00044         userrec::QuitUser(ServerInstance, user, quitmsg);
00045 
00046         return CMD_SUCCESS;
00047 }


The documentation for this class was generated from the following files: