Skip to content

Commit

Permalink
Check channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Mottram committed May 24, 2021
1 parent 41a4308 commit 9130183
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ Messages can be filtered. Filters can also contain wildcard characters.
To assign other operators who can help with moderation:

/mode +o #channel [nickname]

To only allow registered users onto channels:

/mode +M


License
Expand Down
34 changes: 18 additions & 16 deletions miniircd
Original file line number Diff line number Diff line change
Expand Up @@ -780,23 +780,25 @@ class Client:
meta=True
)
elif flag == b"+M" or flag == b"+R":
if not self.server.registered_only:
self.server.registered_only = True
self.message_channel(
channel,
b"MODE",
b"%s -M" % (channel.name),
True
)
if irc_lower(channel.name) in self.channels:
if not self.server.registered_only:
self.server.registered_only = True
self.message_channel(
channel,
b"MODE",
b"%s -M" % (channel.name),
True
)
elif flag == b"-M" or flag == b"-R":
if self.server.registered_only:
self.server.registered_only = False
self.message_channel(
channel,
b"MODE",
b"%s -M" % (channel.name),
True
)
if irc_lower(channel.name) in self.channels:
if self.server.registered_only:
self.server.registered_only = False
self.message_channel(
channel,
b"MODE",
b"%s -M" % (channel.name),
True
)
else:
self.reply(
b"472 %s %s :Unknown MODE flag" % (self.nickname, flag)
Expand Down

0 comments on commit 9130183

Please sign in to comment.