Skip to content

Commit 0c92aa8

Browse files
committed
Warn if "Send '!nick file' as Priv. Message" set.
1 parent 038584d commit 0c92aa8

File tree

1 file changed

+49
-3
lines changed

1 file changed

+49
-3
lines changed

dlFilter.mrc

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ dlFilter uses the following code from other people:
4242
/* CHANGE LOG
4343
4444
Immediate TODO
45-
Write code to identify mIRC options.
4645
On start / load ensure that Options / Sounds / Requests is not set (since it misdirects triggers). (Need an option to disable this.)
4746
Test location and filename for oNotice log files
4847
Be smarter about matching nicks responding to file requests with triggers when they don't quite match.
@@ -108,6 +107,7 @@ dlFilter uses the following code from other people:
108107
Add support for /MSG nick XDCC SEND as a file request.
109108
Close filter window now closes / hides (depending on keep in background) all Filter / FilterSearch windows.
110109
Options dialog is now associated with active window's connection so show of Filter / Ads makes correct window active.
110+
On start / load warn user if "Options/Sounds/Requests/Send '!nick file' as Private Message" is checked (since it misdirects triggers).
111111
112112
*/
113113

@@ -249,6 +249,7 @@ alias -l DLF.Initialise {
249249
DLF.Ops.AdvertsEnable
250250
var %ver $DLF.mIRCversion
251251
if (%ver != 0) DLF.Error dlFilter requires %ver $+ +. dlFilter disabled until mIRC is updated.
252+
if ($sendPlingNickAsPrivate) DLF.Warning You have $qt(Options/Sounds/Requests/Send '!nick file' as Private Message) checked - if you are using dlFilter in a channel which uses ! as a trigger character, you should uncheck this mIRC option.
252253
}
253254

254255
; If user manually unloads, do clean-up
@@ -5438,12 +5439,12 @@ alias -l DLF.CreateHashTables {
54385439
; ========== Status and error messages ==========
54395440
alias -l DLF.logo return $rev([dlFilter])
54405441
alias -l DLF.StatusAll {
5441-
var %m $c(1,9,$DLF.logo $1-)
5442+
var %m $DLF.logo $c(1,9,$1-)
54425443
scon -a echo -ti2nbfs %m
54435444
if (($window($active).type !isin status custom listbox) || ($left($active,2) == @#)) echo -ti2na %m
54445445
}
54455446
alias -l DLF.Status { echo -ti2sf $c(1,9,$DLF.logo $1-) }
5446-
alias -l DLF.Warning { DLF.StatusAll $c(1,9,$DLF.logo Warning: $1-) }
5447+
alias -l DLF.Warning { DLF.StatusAll $c(1,7,Warning: $1-) }
54475448
alias -l DLF.Error {
54485449
DLF.StatusAll $c(4,$b(Error:)) $1-
54495450
halt
@@ -5765,6 +5766,9 @@ alias -l winscript {
57655766
}
57665767

57675768
; ========== Binary file encode/decode ==========
5769+
; These routines are used to allow multiple files to be delivered as a single mIRC script.
5770+
; You can encode binary files (e.g. dlls, gifs) as mIRC script lines and include them in DLF,
5771+
; and then use the script lines to recreate the binary file from the mIRC script.
57685772
alias -l DLF.CreateBinaryFile {
57695773
if (($0 < 2) || (!$regex($1,/^&[^ ]+$/))) DLF.Error DLF.CreateBinaryFile: Invalid parameters: $1-
57705774
var %len $decode($1,mb)
@@ -5922,6 +5926,7 @@ alias -l enablenickcolors return $DLF.mIRCini(options,0,32)
59225926
alias -l shortjoinsparts return $DLF.mIRCini(options,2,19)
59235927
alias -l windowbuffer return $DLF.mIRCini(options,3,1)
59245928
alias -l usesinglemsg return $DLF.mIRCini(options,0,22)
5929+
alias -l sendPlingNickAsPrivate return $DLF.mIRCini(options,1,23)
59255930

59265931
alias -l DLF.mIRCini {
59275932
var %item $2
@@ -5931,6 +5936,47 @@ alias -l DLF.mIRCini {
59315936
return $gettok(%ini,$3,$asc($comma))
59325937
}
59335938

5939+
alias DLF.mIRCiniDelta {
5940+
if (%DLF.mIRCiniTemp != $null) {
5941+
; Write old ini to a temp file then iterate through sections and entries in each section to find differences.
5942+
var %topics $ini($mircini,0)
5943+
while (%topics) {
5944+
var %topic $ini($mircini,%topics)
5945+
var %items $ini($mircini,%topic,0)
5946+
while (%items) {
5947+
var %item $ini($mircini,%topic,%items)
5948+
var %new $readini($mircini,n,%topic,%item)
5949+
var %old $readini(%DLF.mIRCiniTemp,n,%topic,%item)
5950+
if (%new !== %old) {
5951+
var %news $numtok(%new,$asc($comma))
5952+
var %olds $numtok(%old,$asc($comma))
5953+
if ((%news != %olds) || ((%n == 1) && ($numtok(%old,$asc($comma)) == 1))) {
5954+
echo -ac Normal OLD %topic %item = %old
5955+
echo -ac Normal NEW %topic %item = %new
5956+
}
5957+
else {
5958+
while (%news) {
5959+
if ($gettok(%new,%news,$asc($comma)) != $gettok(%old,%news,$asc($comma))) {
5960+
echo -ac Normal OLD %topic %item %news = $gettok(%old,%news,$asc($comma))
5961+
echo -ac Normal NEW %topic %item %news = $gettok(%new,%news,$asc($comma))
5962+
}
5963+
dec %news
5964+
}
5965+
}
5966+
}
5967+
dec %items
5968+
}
5969+
dec %topics
5970+
}
5971+
}
5972+
5973+
; Save current mIRCini
5974+
set -e %DLF.mIRCiniTemp $qt($tempfn)
5975+
bread $qt($mircini) 0 $file($mircini).size &DLFmIRCini
5976+
bwrite -c %DLF.mIRCiniTemp 0 -1 &DLFmIRCini
5977+
echo -ac ctcp Change options and run it again to see mIRCini differences.
5978+
}
5979+
59345980
; ========== DLF.Watch.* ==========
59355981
; Routines to help developers by providing a filtered debug window
59365982
menu @dlF.Watch.* {

0 commit comments

Comments
 (0)