@@ -108,6 +108,7 @@ dlFilter uses the following code from other people:
108
108
Close filter window now closes / hides (depending on keep in background) all Filter / FilterSearch windows.
109
109
Options dialog is now associated with active window's connection so show of Filter / Ads makes correct window active.
110
110
On start / load warn user if "Options/Sounds/Requests/Send '!nick file' as Private Message" is checked (since it misdirects triggers).
111
+ Fix interception of DCC ACCEPT CTCP messages preventing DCC SEND resumes.
111
112
112
113
*/
113
114
@@ -578,6 +579,7 @@ ctcp ^*:PING*:?: { DLF.Priv.ctcpBlock $1- }
578
579
579
580
ctcp *:DCC CHAT *:?: { DLF.DccChat.Chat $1- }
580
581
ctcp *:DCC SEND *:?: { DLF.DccSend.Send $1- }
582
+ ctcp *:DCC ACCEPT *:?: { DLF.DccSend.Accept $1- }
581
583
ctcp *:*:?: { DLF.Priv.ctcp $1- }
582
584
ctcp *:*:%DLF.channels : { if ($DLF.Chan.IsChanEvent ) DLF.Chan.ctcp $1- }
583
585
@@ -1477,13 +1479,13 @@ alias -l DLF.Priv.ctcpReply {
1477
1479
alias -l DLF.Priv.SpamFilter {
1478
1480
if (%DLF.opwarning.spamchan == 1 ) {
1479
1481
var %msg $c (4 ,15 ,Private spam from $nick $br ($address ($nick ,5 )) $+ : $q ($1- ))
1480
- var %i $comchan ($nick ,0 )
1482
+ var %i $comchan ($nick ,0 ). op
1481
1483
while (%i ) {
1482
- var %chan $comchan ($nick ,%i )
1483
- if ( $me isop %chan ) . DLF.notice @ $+ $ chan $logo %msg
1484
+ var %chan $comchan ($nick ,%i ). op
1485
+ . DLF.notice @ $+ % chan $logo %msg
1484
1486
dec %i
1485
1487
}
1486
- DLF.Win.Echo Filter Blocked Private $nick %msg
1488
+ DLF.Win.Echo Blocked Private $nick %msg
1487
1489
}
1488
1490
DLF.Win.Filter $1-
1489
1491
}
@@ -1874,7 +1876,6 @@ alias -l DLF.DccSend.GetRequest {
1874
1876
return $hfind (DLF.dccsend.requests,$+ ($network ,|*|,%trig ,|,%srch ,|*),1 ,w).item
1875
1877
}
1876
1878
}
1877
- DLF.Watch.Log hfind(DLF.dccsend.requests, $+ ($network ,|*|XDCC-,$nick ,|*|*) ,1 ,w).item
1878
1879
var %req $hfind (DLF.dccsend.requests,$+ ($network ,|*|XDCC-,$nick ,|*|*),1 ,w).item
1879
1880
if (%req ) return %req
1880
1881
var %req $hfind (DLF.dccsend.requests,$+ ($network ,|*|@,$nick ,||),1 ,w).item
@@ -1953,7 +1954,7 @@ alias -l DLF.DccSend.SendNotice {
1953
1954
1954
1955
alias -l DLF.DccSend.Send {
1955
1956
DLF.Watch.Called DLF.DccSend.Send : $1-
1956
- var %fn $DLF.GetFileName ( $3- )
1957
+ var %fn $noqt ( $gettok ( $3- ,-4-1, $asc ( $space )) )
1957
1958
if ($chr (8238 ) isin %fn ) {
1958
1959
DLF.Win.Echo Blocked Private $nick DCC Send - filename contains malicious unicode U+8238
1959
1960
DLF.Halt Blocked: DCC Send - filename contains malicious unicode U+8238
@@ -1963,7 +1964,7 @@ alias -l DLF.DccSend.Send {
1963
1964
if ($DLF.DccSend.IsRequest (%fn )) {
1964
1965
if ((%DLF.dccsend.autoaccept == 1 ) && (! %trusted )) DLF.DccSend.TrustAdd
1965
1966
DLF.Watch.Log Accepted: DCC Send - you requested this file from this server
1966
- DLF.DccSend.Receiving %fn
1967
+ DLF.DccSend.Receiving $1-
1967
1968
return
1968
1969
}
1969
1970
if (! %trusted ) {
@@ -1980,7 +1981,7 @@ alias -l DLF.DccSend.Send {
1980
1981
DLF.Watch.Log DCC Send accepted from untrusted user due to file receiving options
1981
1982
}
1982
1983
else DLF.Watch.Log DCC Send accepted from trusted user
1983
- DLF.DccSend.Receiving %fn
1984
+ DLF.DccSend.Receiving $1-
1984
1985
}
1985
1986
1986
1987
alias -l DLF.DccSend.Block {
@@ -1993,17 +1994,74 @@ alias -l DLF.DccSend.Block {
1993
1994
}
1994
1995
1995
1996
alias -l DLF.DccSend.Receiving {
1996
- var %req $DLF.DccSend.GetRequest ($1- )
1997
+ var %fn $noqt ($gettok ($3- ,-4-1,$asc ($space )))
1998
+ DLF.DccSend.AddAccepted %fn
1999
+ var %req $DLF.DccSend.GetRequest (%fn )
1997
2000
if (%req == $null ) return
1998
2001
var %chan $gettok (%req ,2 ,$asc (|))
1999
2002
var %origfn $decode ($gettok (%req ,5 ,$asc (|)))
2000
- if (%origfn == $null ) %origfn = $1-
2003
+ if (%origfn == $null ) %origfn = %fn
2001
2004
var %secs 86400 - $hget (DLF.dccsend.requests,%req )
2002
- DLF.Win.Log Server ctcp %chan $nick DCC Get of $qt (%origfn ) from $nick starting $br (waited $duration (%secs ,3 ))
2005
+ var %starting starting
2006
+ if ($dccIfFileExists == Resume) {
2007
+ var %pathfile $+ ($getdir (%fn ),%fn )
2008
+ if ($isfile (%pathfile )) {
2009
+ if ($file (%pathfile ).size > 0 ) %starting = resuming
2010
+ }
2011
+ }
2012
+ DLF.Win.Log Server ctcp %chan $nick DCC Get of $qt (%origfn ) from $nick %starting $br (waited $duration (%secs ,3 ))
2013
+ }
2014
+
2015
+ alias -l DLF.DccSend.Accept {
2016
+ DLF.Watch.Called DLF.DccSend.Accept : $1-
2017
+ var %fn $noqt ($gettok ($3- ,-3-1,$asc ($space )))
2018
+ if ($DLF.DccSend.IsntAccepted (%fn )) DLF.Priv.ctcp $1-
2019
+ }
2020
+
2021
+ alias -l DLF.DccSend.AddAccepted {
2022
+ var %hash $DLF.DccSend.Hash ($1- )
2023
+ . hadd -mz DLF.dccsend.accepted %hash 300
2024
+ }
2025
+
2026
+ alias -l DLF.DccSend.IsntAccepted {
2027
+ var %hash $DLF.DccSend.Hash ($1- )
2028
+ if ($hget (DLF.dccsend.accepted,%hash )) return $false
2029
+ return $true
2030
+ }
2031
+
2032
+ alias -l DLF.DccSend.DelAccepted {
2033
+ var %hash $DLF.DccSend.Hash ($1- )
2034
+ if ($hget (DLF.dccsend.accepted,%hash )) . hdel DLF.dccsend.accepted %hash
2035
+ }
2036
+
2037
+ alias -l DLF.DccSend.Hash { return $encode ($network $nick $1- ) }
2038
+
2039
+ alias -l DLF.DccSend.Retry {
2040
+ if (! %DLF.serverretry ) return $false
2041
+ var %hash $DLF.DccSend.Hash ($1- )
2042
+ var %attempts $hget (DLF.dccsend.retries,%hash )
2043
+ if (%attempts == 3 ) {
2044
+ DLF.DccSend.RetryDelete $1-
2045
+ return $false
2046
+ }
2047
+ if (%attempts == $null ) {
2048
+ ; First retry
2049
+ . hadd -m DLF.dccsend.retries %hash 1
2050
+ }
2051
+ else {
2052
+ . hinc DLF.dccsend.retries %hash
2053
+ }
2054
+ return $true
2055
+ }
2056
+
2057
+ alias -l DLF.DccSend.RetryDelete {
2058
+ var %hash $DLF.DccSend.Hash ($1- )
2059
+ if ($hget (DLF.dccsend.retries,%hash )) . hdel DLF.dccsend.retries %hash
2003
2060
}
2004
2061
2005
2062
alias -l DLF.DccSend.FileRcvd {
2006
2063
var %fn $nopath ($filename )
2064
+ DLF.DccSend.DelAccepted %fn
2007
2065
DLF.Watch.Called DLF.DccSend.FileRcvd %fn : $1-
2008
2066
var %req $DLF.DccSend.GetRequest (%fn )
2009
2067
if (%req == $null ) return
@@ -2013,8 +2071,7 @@ alias -l DLF.DccSend.FileRcvd {
2013
2071
var %trig $gettok (%req ,3 ,$asc (|))
2014
2072
var %origfn $decode ($gettok (%req ,5 ,$asc (|)))
2015
2073
if (%origfn == $null ) %origfn = %fn
2016
- var %hash $encode (%trig %origfn )
2017
- if ($hget (DLF.dccsend.retries,%hash )) . hdel DLF.dccsend.retries %hash
2074
+ DLF.DccSend.RetryDelete %trig %origfn
2018
2075
var %bytes $get (-1 ).rcvd / %dur
2019
2076
DLF.Win.Log Server ctcp %chan $nick DCC Get of $qt (%origfn ) from $nick complete $br ($duration (%dur ,3 ) $bytes (%bytes ,3 ).suf $+ /Sec)
2020
2077
; Some servers change spaces to underscores
@@ -2064,31 +2121,16 @@ alias -l DLF.DccSend.GetFailed {
2064
2121
2065
2122
var %fn $nopath ($filename )
2066
2123
DLF.Watch.Called DLF.DccSend.GetFailed %fn : $1-
2124
+ DLF.DccSend.DelAccepted %fn
2067
2125
var %req $DLF.DccSend.GetRequest (%fn )
2068
2126
if (%req == $null ) return
2069
2127
. hdel -s DLF.dccsend.requests %req
2070
2128
var %chan $gettok (%req ,2 ,$asc (|))
2071
2129
var %trig $gettok (%req ,3 ,$asc (|))
2072
2130
var %origfn $decode ($gettok (%req ,5 ,$asc (|)))
2073
2131
if (%origfn == $null ) %origfn = %fn
2074
- var %hash $encode (%trig %origfn )
2075
- var %retry %DLF.serverretry
2076
- if (%retry ) {
2077
- var %attempts $hget (DLF.dccsend.retries,%hash )
2078
- if (%attempts == $null ) {
2079
- ; First retry
2080
- . hadd -m DLF.dccsend.retries %hash 1
2081
- }
2082
- elseif (%attempts == 3 ) {
2083
- . hdel DLF.dccsend.retries %hash
2084
- %retry = $false
2085
- }
2086
- else {
2087
- . hinc DLF.dccsend.retries %hash
2088
- }
2089
- }
2090
2132
var %bytes $get (-1 ).rcvd / $get (-1 ).secs
2091
- var %retrying
2133
+ var %retry $DLF.DccSend.Retry ( %trig %origfn ), % retrying
2092
2134
if (%retry ) %retrying = - $c (3 ,retrying)
2093
2135
DLF.Win.Log Server ctcp %chan $nick DCC Get of %origfn from $nick incomplete $br ($duration (%dur ,3 ) $bytes (%bytes ).suf $+ /Sec) %retrying
2094
2136
if (xdcc-* iswm %trig ) %trig = $null
@@ -5556,9 +5598,11 @@ alias -l DLF.IsServiceUser {
5556
5598
return $false
5557
5599
}
5558
5600
5601
+ ; Remove trailing stuff from filename
5602
+ ; Common (OmenServe) response has filename followed by e.g. ::INFO::
5603
+ ; and colons are not allowable characters in file names
5604
+ ; DCC SEND / ACCEPT messages have ipaddress port filesize or position following filename
5559
5605
alias -l DLF.GetFileName {
5560
- ; common (OmenServe) response has filename followed by e.g. ::INFO::
5561
- ; and colons are not allowable characters in file names
5562
5606
var %txt $gettok ($replace ($strip ($1- ),$nbsp ,$space ,$tab $+ $space ,$space ,$tab ,$null ),1 ,$asc (:))
5563
5607
var %n $numtok (%txt ,$asc ($space ))
5564
5608
; delete trailing info: CRC(*) or (*)
@@ -5913,6 +5957,14 @@ alias -l shortjoinsparts return $DLF.mIRCini(options,2,19)
5913
5957
alias -l windowbuffer return $DLF.mIRCini (options,3 ,1 )
5914
5958
alias -l usesinglemsg return $DLF.mIRCini (options,0 ,22 )
5915
5959
alias -l sendPlingNickAsPrivate return $DLF.mIRCini (options,1 ,23 )
5960
+ alias -l dccIfFileExists {
5961
+ var %value = $DLF.mIRCini (options,1 ,27 )
5962
+ if (%value == 0 ) return Ask
5963
+ if (%value == 1 ) return Resume
5964
+ if (%value == 2 ) return Overwrite
5965
+ if (%value == 3 ) return Cancel
5966
+ return Unknown
5967
+ }
5916
5968
5917
5969
alias -l DLF.mIRCini {
5918
5970
var %item $2
0 commit comments