src/irc.c
changeset 19 66114d944208
parent 18 4435146391ae
child 22 b786b5f92a93
equal deleted inserted replaced
18:4435146391ae 19:66114d944208
    30 #define   ERROR  7
    30 #define   ERROR  7
    31 #define VERSION  8
    31 #define VERSION  8
    32 #define PRIVMSG  9
    32 #define PRIVMSG  9
    33 #define    QUIT 10
    33 #define    QUIT 10
    34 #define    NICK 11
    34 #define    NICK 11
       
    35 #define    KICK 12
    35 
    36 
    36 #define VERSION_STRING "MCBOT on GNU/LINUX"
    37 #define VERSION_STRING "MCBOT on GNU/LINUX"
    37 
    38 
    38 const char *IRC_Commands[] = {
    39 const char *IRC_Commands[] = {
    39     "NOTICE", "MODE", "JOIN", "PART",
    40     "NOTICE", "MODE", "JOIN", "PART",
    40     "TOPIC", "PING", "ENOMEM", "ERROR",
    41     "TOPIC", "PING", "ENOMEM", "ERROR",
    41     "VERSION", "PRIVMSG", "QUIT", "NICK",
    42     "VERSION", "PRIVMSG", "QUIT", "NICK",
    42     NULL
    43     "KICK", NULL
    43 };
    44 };
    44 
    45 
    45 FILE *irc_connect (char *server, unsigned int port)
    46 FILE *irc_connect (char *server, unsigned int port)
    46 {
    47 {
    47     struct hostent *he;
    48     struct hostent *he;
   271                     return NULL;
   272                     return NULL;
   272                 case QUIT:
   273                 case QUIT:
   273                     message->channel = message->user;
   274                     message->channel = message->user;
   274                     return command;
   275                     return command;
   275                 case NICK:
   276                 case NICK:
       
   277                     message->channel = message->user;
       
   278                     return command;
       
   279                 case KICK:
   276                     message->channel = message->user;
   280                     message->channel = message->user;
   277                     return command;
   281                     return command;
   278                 }
   282                 }
   279             }
   283             }
   280             i++;
   284             i++;