mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 09:45:18 +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
|
continue
|
||||||
for item in line[k+1:k2]:
|
for item in line[k+1:k2]:
|
||||||
if item[0:2] == 'E_':
|
if item[0:2] == 'E_':
|
||||||
s.send('USERHOST %s\n'%item)
|
s.send('WHO %s\n'%item)
|
||||||
elif '302' in line: # answer to /userhost
|
elif '352' in line: # answer to /who
|
||||||
k = line.index('302')
|
# warning: this is a horrible hack which apparently works
|
||||||
m = re.match( "^:(.*?)=\+~(.*?)@(.*?)$", line[k+2] )
|
name = line[2]
|
||||||
if m:
|
ip = line[10]
|
||||||
name = m.group(1)
|
host = line[5]
|
||||||
host = m.group(2)
|
peer_list[name] = (ip,host)
|
||||||
ip = m.group(3)
|
|
||||||
peer_list[name] = (ip,host)
|
|
||||||
elif time.time() - t > 5*60:
|
elif time.time() - t > 5*60:
|
||||||
s.send('NAMES #electrum\n')
|
s.send('NAMES #electrum\n')
|
||||||
t = time.time()
|
t = time.time()
|
||||||
|
|
Loading…
Add table
Reference in a new issue