cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

Support for reverse DCC SEND #248

Open obfuscoder opened 6 years ago

obfuscoder commented 6 years ago

At the moment cinch does not support reverse dcc sends.

https://en.wikipedia.org/wiki/Direct_Client-to-Client#Reverse_.2F_Firewall_DCC

It doesn't detect these messages and never fires the dcc_send event. This is due to the regex used:

message =~ /^\001DCC SEND (?:"([^"]+)"|(\S+)) (\S+) (\d+)(?: (\d+))?\001$/

For reverse DCCs the port is set to 0 and the filesize is followed by an additional parameter - a token.

The first step towards supporting reverse DCCs would be to detect them by updating the regex.