|
@@ -15,17 +15,17 @@ func (i *IRCCat) handleCommand(event *irc.Event) {
|
15
|
15
|
msg := event.Message()
|
16
|
16
|
channel := ""
|
17
|
17
|
respond_to := event.Arguments[0]
|
18
|
|
- if respond_to[0] != '#' {
|
19
|
|
- respond_to = event.Nick
|
20
|
|
- } else {
|
|
18
|
+
|
|
19
|
+ if i.inChannel(respond_to) {
|
21
|
20
|
channel = respond_to
|
|
21
|
+ } else {
|
|
22
|
+ respond_to = event.Nick
|
|
23
|
+ if !i.authorisedUser(event.Nick) {
|
|
24
|
+ log.Infof("Unauthorised command: %s (%s) %s", event.Nick, respond_to, msg)
|
|
25
|
+ return
|
|
26
|
+ }
|
22
|
27
|
}
|
23
|
28
|
|
24
|
|
- if event.Arguments[0][0] != '#' && !i.authorisedUser(event.Nick) {
|
25
|
|
- // Command not in a channel, or not from an authorised user
|
26
|
|
- log.Infof("Unauthorised command: %s (%s) %s", event.Nick, respond_to, msg)
|
27
|
|
- return
|
28
|
|
- }
|
29
|
29
|
log.Infof("Authorised command: %s (%s) %s", event.Nick, respond_to, msg)
|
30
|
30
|
|
31
|
31
|
parts := strings.SplitN(msg, " ", 2)
|