mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
* move server's hostname on IRC to realname, part 2: parsing the output of /who
This commit is contained in:
parent
51dd46e84e
commit
68790df27f
1 changed files with 7 additions and 9 deletions
|
@ -461,15 +461,13 @@ def irc_thread():
|
|||
continue
|
||||
for item in line[k+1:k2]:
|
||||
if item[0:2] == 'E_':
|
||||
s.send('USERHOST %s\n'%item)
|
||||
elif '302' in line: # answer to /userhost
|
||||
k = line.index('302')
|
||||
m = re.match( "^:(.*?)=\+~(.*?)@(.*?)$", line[k+2] )
|
||||
if m:
|
||||
name = m.group(1)
|
||||
host = m.group(2)
|
||||
ip = m.group(3)
|
||||
peer_list[name] = (ip,host)
|
||||
s.send('WHO %s\n'%item)
|
||||
elif '352' in line: # answer to /who
|
||||
# warning: this is a horrible hack which apparently works
|
||||
name = line[2]
|
||||
ip = line[10]
|
||||
host = line[5]
|
||||
peer_list[name] = (ip,host)
|
||||
elif time.time() - t > 5*60:
|
||||
s.send('NAMES #electrum\n')
|
||||
t = time.time()
|
||||
|
|
Loading…
Add table
Reference in a new issue