Skip to content

Commit

Permalink
This working blowing over my mind
Browse files Browse the repository at this point in the history
  • Loading branch information
arthunix committed Jun 7, 2023
1 parent aba196b commit 7be9783
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions servidor
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ def dados_recebidos(conexao, dados):
for i in servidor.chan_db[pUpper]:
servidor.chan_db[pUpper][i].enviar(b':' + connectionNick + b' JOIN :' + payload + b'\r\n')

if command.upper() == b'PART':
pIgnored = payload.split(b' ')[0]
pUpper = payload.split(b' ')[0].upper()

if pUpper.startswith(b'#') and pUpper in servidor.chan_db.keys():
connectionNick = list(servidor.nick_db.keys())[list(servidor.nick_db.values()).index(conexao)]
if connectionNick in servidor.chan_db[pUpper].keys():
for i in servidor.chan_db[pUpper]:
servidor.chan_db[pUpper][i].enviar(b':' + connectionNick + b' PART ' + pIgnored + b'\r\n')
del servidor.chan_db[pUpper][connectionNick]

def conexao_aceita(conexao):
print(conexao, 'nova conexão')
servidor.conn_db.append(conexao)
Expand Down

0 comments on commit 7be9783

Please sign in to comment.