# and new msg events are handled by the command procedures, not here.
global calling_nick
if {[info exists calling_nick]} { set save $calling_nick }
-puts "[list tell_event $nl $event]"
switch -exact $event {
none { }
talk {
}
}
if {[info exists save]} { set calling_nick $save }
-global errorInfo
-puts "[list tell_event $nl $event] $errorInfo"
}
proc tell_getcstate {} {
append evstate [string range $stt 0 0]
append evstate [string range $event 0 0]
- manyset [tell_effective_sec $nl] sec secwhen
+ manyset [nickdb_get_sec_effective $nl] sec secwhen
switch -exact $sec {
insecure { append evstate ii }
secure { append evstate [expr {$ago<$secwhen ? "sl" : "ss"}] }
}
upvar #0 nick_username($nl) nu
- if {[info exists nu] && "$nu" == "[nickdb_get $nl username]"} {
+ if {[info exists nu] && "$nu" == "[nickdb_get_username $nl]"} {
append evstate i
} else {
append evstate u
default { append evstate "#$rel#" }
}
+ log "tell_event_core1 core evstate=$evstate (ago=$ago)"
switch -glob $evstate {
pt???rv {
# consider delivered:
}
ni????? - naii??? - nas?i?? - mi????? - pa????l {
# pass and then stuff
- if {[length $iml] == 3} {
+ if {[llength $iml] == 3} {
manyset $iml sender sentwhen msg
sendprivmsg $nl \
- "$sender asked me [showintervalsecs [expr {$now-$sentwhen}] 0]\
+ "$sender asked me [showinterval [expr {$now-$sentwhen}]]\
to tell you: $msg"
} else {
sendprivmsg $nl \
set chan_initialop([irctolower $chan]) $u
sendprivmsg $n \
"Thanks. You can use `channel manager ...' to register this channel."
- if {![nickdb_exists $n] || ![string length [nickdb_get $n username]]} {
+ if {![string length [nickdb_get_username $n username]]} {
sendprivmsg $n \
"(But to do that you must register your nick securely first.)"
}
channel/$subcmd
}
-proc tell_effective_sec {n} {
+proc nickdb_get_username {n} {
+ if {![nickdb_exists $n]} { return "" }
+ return [nickdb_get $n username]
+}
+
+proc nickdb_get_sec_effective {n} {
set l [nickdb_get $n tellsec]
- set u [nickdb_get $n username]
+ set u [nickdb_get_username $n]
if {"[lindex $l 0]" == "secure" && ![string length $u]} { set l insecure }
return $l
}
prefix_nick
set nl [irctolower $n]
check_notonchan
- manyset [tell_effective_sec $n] sec secwhen
+ manyset [nickdb_get_sec_effective $n] sec secwhen
switch -exact $sec {
insecure { }
refuse - mailto {
set ctarget $target
if {[info exists nick_case($ltarget)]} { set ctarget $nick_case($ltarget) }
- manyset [tell_effective_sec $target] sec mailtoint mailwhy
+ manyset [nickdb_get_sec_effective $target] sec mailtoint mailwhy
manyset [nickdb_get $target tellrel] rel relint relwithin
switch -exact $sec {
insecure - secure {
return "I'll tell you your messages whenever I see you."
}
secure {
- if {[string length [nickdb_get $n username]]} {
+ if {[string length [nickdb_get_username $n]]} {
return \
"I'll keep the bodies of your messages private until you identify yourself, reminding you every [showintervalsecs $mailtoint 1]."
} else {
}
mailto {
telling_setting_neednomsgs
- set u [nickdb_get $n username]
- if {[string length $u]} {
+
+ if {[string length [set u [nickdb_get_username $n]]]} {
usererror \
"Sorry, you must register securely to have your messages mailed\
(to prevent the use of this feature for spamming). See `help register'."