forked from lesderid/salty-ircd
Ignore JOIN if user is already on channel
This commit is contained in:
parent
f80070aa92
commit
786a3f17e8
|
@ -389,4 +389,9 @@ class Channel
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool hasMember(Connection connection)
|
||||
{
|
||||
return members.canFind(connection);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -398,7 +398,6 @@ class Connection
|
|||
auto channelList = message.parameters[0].split(',');
|
||||
foreach (channelName; channelList)
|
||||
{
|
||||
//TODO: Check if the user isn't already on the channel
|
||||
if (!Server.isValidChannelName(channelName))
|
||||
{
|
||||
sendErrNoSuchChannel(channelName);
|
||||
|
@ -413,6 +412,15 @@ class Connection
|
|||
else
|
||||
{
|
||||
auto channel = channelRange[0];
|
||||
|
||||
if (channel.hasMember(this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO: Implement channel limit
|
||||
//TODO: Implement channel key
|
||||
|
||||
if (channel.maskLists['b'].any!(m => matchesMask(m)))
|
||||
{
|
||||
send(Message(_server.name, "474", [
|
||||
|
@ -427,9 +435,7 @@ class Connection
|
|||
nick, channelName, "Cannot join channel (+i)"
|
||||
], true));
|
||||
}
|
||||
//TODO: Implement channel limit
|
||||
//TODO: Implement channel key
|
||||
else
|
||||
else
|
||||
{
|
||||
_server.join(this, channelName);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue