+# Determines if the Wikidata channel is Wikidata specific
+# Wikidata channels allow commands for everyone, not only for D users.
+proc isWikidataChannel {chan} {
+ expr [lsearch [registry get wikidata.channels] $chan] != -1
+}
+
+# Determines if the specified handle on the specified channel
+# is allowed to run a Wikidata comamnd.
+proc areWikidataCommandsAllowed {chan handle} {
+ if {[matchattr $handle D]} {
+ return 1
+ }
+
+ isWikidataChannel $chan
+}
+
# Handles .+surname command
proc pub:surname {nick uhost handle chan arg} {
+ if {![areWikidataCommandsAllowed $chan $handle]} {
+ return 0
+ }
+
if {[isAcceptableItemTitle $arg]} {
create_surname $arg "serv $chan"
return 1
} {
putserv "PRIVMSG $chan :$nick : ne sont gérés comme que les caractères alphanumériques, le tiret, l'apostrophe droite, de même que tout ce qui n'est pas ASCII standard."
}
return 0
}
# Handles .+surname command
proc dcc:surname {handle idx arg} {
if {[isAcceptableItemTitle $arg]} {
create_surname $arg "dcc $idx"
return 1
} {
putdcc $idx "crée cet item manuellement, je ne suis pas conçu pour gérer ces caractères dans le titre."
}
return 0
}
# Creates a surname
# @param $title the item title
# @param $state the state to pass to the create command callback (here with a mode and a target to print result)