Skip to content

Commit 5ecb9bd

Browse files
committed
Make sure to always send /mode when joining a channel
1 parent 5841c6d commit 5ecb9bd

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

plugins/admin_bot.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,8 @@ def join(text, conn, nick, message, notice):
251251
target = "#{}".format(target)
252252
if logchannel:
253253
message("{} used JOIN to make me join {}.".format(nick, target), logchannel)
254-
mode = "mode {}".format(target)
255254
notice("Attempting to join {}...".format(target))
256255
conn.join(target)
257-
conn.send(mode)
258256

259257

260258
@asyncio.coroutine

plugins/core_misc.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ def invite(irc_paramlist, conn):
1616
"""
1717
invite_join = conn.config.get('invite_join', True)
1818
if invite_join:
19-
mode = "mode {}".format(irc_paramlist[-1])
20-
conn.send(mode)
2119
conn.join(irc_paramlist[-1])
2220

21+
22+
@hook.irc_raw('JOIN')
23+
def on_join(chan, conn):
24+
conn.cmd("MODE", chan)
25+
26+
2327
@hook.irc_raw('324')
2428
def check_mode(irc_paramlist, conn, message):
2529
#message(", ".join(irc_paramlist), "bloodygonzo")
@@ -29,7 +33,7 @@ def check_mode(irc_paramlist, conn, message):
2933
message("I do not stay in unregistered channels", irc_paramlist[1])
3034
out = "PART {}".format(irc_paramlist[1])
3135
conn.send(out)
32-
36+
3337

3438
# Identify to NickServ (or other service)
3539
@asyncio.coroutine
@@ -77,9 +81,6 @@ def onjoin(conn, bot):
7781
for channel in conn.channels:
7882
conn.join(channel)
7983
yield from asyncio.sleep(0.4)
80-
if conn.name == "snoonet":
81-
mode = "mode {}".format(channel)
82-
conn.send(mode)
8384

8485
conn.ready = True
8586
bot.logger.info("[{}|misc] Bot has finished sending join commands for network.".format(conn.name))

0 commit comments

Comments
 (0)