Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3715877
D605.id1472.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D605.id1472.diff
View Options
diff --git a/Daeghrefn/Wikimedia.tcl b/Daeghrefn/Wikimedia.tcl
--- a/Daeghrefn/Wikimedia.tcl
+++ b/Daeghrefn/Wikimedia.tcl
@@ -1,22 +1,42 @@
bind pub - .config pub:config
bind dcc - config dcc:config
-bind pub D .+surname pub:surname
+bind pub - .+surname pub:surname
bind dcc D +surname dcc:surname
-bind pub D .+nom pub:surname
+bind pub - .+nom pub:surname
bind dcc D +nom dcc:surname
-bind pub D .+prenom pub:givenname
+bind pub - .+prenom pub:givenname
bind dcc D +prenom dcc:givenname
-bind pub D .+prénom pub:givenname
+bind pub - .+prénom pub:givenname
bind dcc D +prénom dcc:givenname
-bind pub D .+givenname pub:givenname
+bind pub - .+givenname pub:givenname
bind dcc D +givenname dcc:givenname
#
# Wikidata
#
+# 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
@@ -46,6 +66,10 @@
# Handles .+givenname command
proc pub:givenname {nick uhost handle chan arg} {
+ if {![areWikidataCommandsAllowed $chan $handle]} {
+ return 0
+ }
+
set params [split $arg]
if {[llength $params] == 0} {
putdcc $idx "Quel prénom ajouter ? e.g. .+prenom Aude F"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 10:37 (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2231651
Default Alt Text
D605.id1472.diff (1 KB)
Attached To
Mode
D605: Allow .+prenom and .+nom on #wikidata-fr for every user
Attached
Detach File
Event Timeline
Log In to Comment