IRCP

- information gathering tool for irc servers
git clone git://git.acid.vegas/IRCP.git
Log | Files | Refs | Archive | README | LICENSE

commit 3a6e94bbe0c1b91a9c893b6a97d9d7cbea2d6d0f
parent 03a2e8c4a5b4caec40454661daf0c1ecb83c445b
Author: acidvegas <acid.vegas@acid.vegas>
Date: Wed, 31 May 2023 00:33:36 -0400

Do not JOIN empty channels

Diffstat:
Mircp.py | 13+++++--------

1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/ircp.py b/ircp.py
@@ -349,9 +349,9 @@ class probe:
 						debug(f'{self.display}\033[34mWHOIS\033[0m {nick}')
 				elif numeric == '322' and len(args) >= 4: # RPL_LIST
 					chan  = args[3]
-					self.channels['all'].append(chan)
-					if len(args) >= 5:
-						users = args[4]
+					users = args[4]
+					if users != '0': # no need to JOIN empty channels...
+						self.channels['all'].append(chan)
 						self.channels['users'][chan] = users
 				elif numeric == '323': # RPL_LISTEND
 					if self.channels['all']:
@@ -368,11 +368,8 @@ class probe:
 				elif numeric == '366' and len(args) >= 4: # RPL_ENDOFNAMES
 					chan = args[3]
 					self.channels['current'].append(chan)
-					if chan in self.channels['users']:
-						debug('{0}\033[32mJOIN\033[0m {1} \033[30m(found \033[93m{2}\033[30m users)\033[0m'.format(self.display, chan, self.channels['users'][chan]))
-						del self.channels['users'][chan]
-					else:
-						debug(f'{self.display}\033[32mJOIN\033[0m {chan}')
+					debug('{0}\033[32mJOIN\033[0m {1} \033[30m(found \033[93m{2}\033[30m users)\033[0m'.format(self.display, chan, self.channels['users'][chan]))
+					del self.channels['users'][chan]
 					await self.raw('WHO ' + chan)
 					await asyncio.sleep(throttle.part)
 					await self.raw('PART ' + chan)