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_join Class Reference

Handle /JOIN. More...

#include <cmd_join.h>

Inheritance diagram for cmd_join:

Inheritance graph
[legend]
Collaboration diagram for cmd_join:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Detailed Description

Handle /JOIN.

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_join.h.


Constructor & Destructor Documentation

cmd_join::cmd_join InspIRCd Instance  )  [inline]
 

Constructor for join.

Definition at line 32 of file cmd_join.h.

References command_t::syntax.

00032 : command_t(Instance,"JOIN",0,1) { syntax = "<channel>{,<channel>} {<key>{,<key>}}"; }


Member Function Documentation

CmdResult cmd_join::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 25 of file cmd_join.cpp.

References CMD_FAILURE, CMD_SUCCESS, InspIRCd::IsChannel(), chanrec::JoinUser(), CommandParser::LoopCall(), userrec::nick, InspIRCd::Parser, command_t::ServerInstance, and userrec::WriteServ().

00026 {
00027         if (pcnt > 1)
00028         {
00029                 if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0, 1))
00030                         return CMD_SUCCESS;
00031 
00032                 if (ServerInstance->IsChannel(parameters[0]))
00033                 {
00034                         chanrec::JoinUser(ServerInstance, user, parameters[0], false, parameters[1]);
00035                         return CMD_SUCCESS;
00036                 }
00037         }
00038         else
00039         {
00040                 if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0))
00041                         return CMD_SUCCESS;
00042 
00043                 if (ServerInstance->IsChannel(parameters[0]))
00044                 {
00045                         chanrec::JoinUser(ServerInstance, user, parameters[0], false, "");
00046                         return CMD_SUCCESS;
00047                 }
00048         }
00049 
00050         user->WriteServ("403 %s %s :Invalid channel name",user->nick, parameters[0]);
00051         return CMD_FAILURE;
00052 }


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