| 23 |
|
*/ |
| 24 |
|
|
| 25 |
|
#include "stdinc.h" |
| 26 |
< |
#include "tools.h" |
| 26 |
> |
#include "list.h" |
| 27 |
|
#include "handlers.h" |
| 28 |
– |
#include "common.h" |
| 28 |
|
#include "channel.h" |
| 29 |
|
#include "channel_mode.h" |
| 31 |
– |
#include "list.h" |
| 30 |
|
#include "client.h" |
| 31 |
|
#include "hash.h" |
| 32 |
|
#include "irc_string.h" |
| 47 |
|
{ m_unregistered, m_invite, m_invite, m_ignore, m_invite, m_ignore } |
| 48 |
|
}; |
| 49 |
|
|
| 52 |
– |
#ifndef STATIC_MODULES |
| 50 |
|
void |
| 51 |
|
_modinit(void) |
| 52 |
|
{ |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
const char *_version = "$Revision$"; |
| 66 |
– |
#endif |
| 63 |
|
|
| 64 |
|
/* |
| 65 |
|
** m_invite |
| 79 |
|
if (IsServer(source_p)) |
| 80 |
|
return; |
| 81 |
|
|
| 82 |
< |
if (*parv[2] == '\0') |
| 82 |
> |
if (EmptyString(parv[2])) |
| 83 |
|
{ |
| 84 |
|
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), |
| 85 |
|
me.name, source_p->name, "INVITE"); |
| 118 |
|
return; |
| 119 |
|
} |
| 120 |
|
|
| 121 |
< |
if ((ms = find_channel_link(source_p, chptr)) == NULL) |
| 121 |
> |
if (MyConnect(source_p) && (ms = find_channel_link(source_p, chptr)) == NULL) |
| 122 |
|
{ |
| 123 |
|
sendto_one(source_p, form_str(ERR_NOTONCHANNEL), |
| 124 |
|
me.name, source_p->name, chptr->chname); |
| 125 |
|
return; |
| 126 |
|
} |
| 127 |
|
|
| 128 |
< |
if (ConfigChannel.invite_ops_only || (chptr->mode.mode & MODE_INVITEONLY)) |
| 128 |
> |
if ((chptr->mode.mode & (MODE_INVITEONLY | MODE_PRIVATE))) |
| 129 |
|
{ |
| 130 |
|
if (MyConnect(source_p) && !has_member_flags(ms, CHFL_CHANOP|CHFL_HALFOP)) |
| 131 |
|
{ |
| 156 |
|
if (atoi(parv[3]) > chptr->channelts) |
| 157 |
|
return; |
| 158 |
|
|
| 163 |
– |
if (!MyConnect(target_p) && ServerInfo.hub && |
| 164 |
– |
IsCapable(target_p->from, CAP_LL)) |
| 165 |
– |
{ |
| 166 |
– |
/* target_p is connected to a LL leaf, connected to us */ |
| 167 |
– |
if (IsClient(source_p)) |
| 168 |
– |
client_burst_if_needed(target_p->from, source_p); |
| 169 |
– |
|
| 170 |
– |
if ((chptr->lazyLinkChannelExists & |
| 171 |
– |
target_p->from->localClient->serverMask) == 0) |
| 172 |
– |
burst_channel(target_p->from, chptr); |
| 173 |
– |
} |
| 174 |
– |
|
| 159 |
|
if (MyConnect(target_p)) |
| 160 |
|
{ |
| 161 |
|
sendto_one(target_p, ":%s!%s@%s INVITE %s :%s", |
| 168 |
|
if (chptr->mode.mode & MODE_PRIVATE) |
| 169 |
|
{ |
| 170 |
|
/* Only do this if channel is set +i AND +p */ |
| 171 |
< |
sendto_channel_local(CHFL_CHANOP|CHFL_HALFOP, NO, chptr, |
| 171 |
> |
sendto_channel_local(CHFL_CHANOP|CHFL_HALFOP, 0, chptr, |
| 172 |
|
":%s NOTICE %s :%s is inviting %s to %s.", |
| 173 |
|
me.name, chptr->chname, source_p->name, |
| 174 |
|
target_p->name, chptr->chname); |