1 |
/* Copyright (C) 2003 Stephane Thiell |
2 |
* |
3 |
* This file is part of pxyservd (from pxys) |
4 |
* |
5 |
* This program is free software; you can redistribute it and/or |
6 |
* modify it under the terms of the GNU General Public License |
7 |
* as published by the Free Software Foundation; either version 2 |
8 |
* of the License, or (at your option) any later version. |
9 |
* |
10 |
* This program is distributed in the hope that it will be useful, |
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
* GNU General Public License for more details. |
14 |
* |
15 |
* You should have received a copy of the GNU General Public License |
16 |
* along with this program; if not, write to the Free Software |
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 |
* |
19 |
*/ |
20 |
#define RCSID "$Id: cmd_inv.c,v 1.1.1.1 2003/12/30 17:09:29 mbuna Exp $" |
21 |
|
22 |
#include "irc_cmd.h" |
23 |
#include "irc_msg.h" |
24 |
#include "irc_send.h" |
25 |
#include "cfgloader.h" |
26 |
|
27 |
#include "irc_membership.h" |
28 |
#include "irc_channel.h" |
29 |
#include "irc_client.h" |
30 |
|
31 |
|
32 |
void |
33 |
cmd_inv(struct Client *cptr, toktabptr ttab) |
34 |
{ |
35 |
const char *dst = ttab->tok[0]; |
36 |
struct Channel *ch; |
37 |
|
38 |
if (!gConfig->client.channel) |
39 |
{ |
40 |
send_client_to_one(dst, "Sorry, can't invite you; my console channel" |
41 |
" is disabled."); |
42 |
return; |
43 |
} |
44 |
|
45 |
ch = irc_channel_get(gConfig->client.channel); |
46 |
if (!ch) |
47 |
return; |
48 |
|
49 |
if (irc_membership_exists(ch, cptr)) |
50 |
{ |
51 |
send_client_to_one(dst, "Just whois yourself! You are on %s :-)", |
52 |
ch->chname); |
53 |
return; |
54 |
} |
55 |
|
56 |
send_raw("%s%s " TOK_INVITE " %s %s" CRLF, |
57 |
gMe.yy, MYCLIENT_NUM64, cptr->nick, ch->chname); |
58 |
} |