Browse Source

send nickserv timeout warnings from a full pseudo-nickmask

tags/v1.1.0-rc1
Shivaram Lingamneni 5 years ago
parent
commit
a59212f8dc
2 changed files with 5 additions and 4 deletions
  1. 2
    2
      irc/idletimer.go
  2. 3
    2
      irc/nickserv.go

+ 2
- 2
irc/idletimer.go View File

@@ -269,9 +269,9 @@ func (nt *NickTimer) Touch(rb *ResponseBuffer) {
269 269
 		// #449
270 270
 		for _, mSession := range nt.client.Sessions() {
271 271
 			if mSession == session {
272
-				rb.Add(nil, "NickServ", "NOTICE", tnick, message)
272
+				rb.Add(nil, nsPrefix, "NOTICE", tnick, message)
273 273
 			} else {
274
-				mSession.Send(nil, "NickServ", "NOTICE", tnick, message)
274
+				mSession.Send(nil, nsPrefix, "NOTICE", tnick, message)
275 275
 			}
276 276
 		}
277 277
 	} else if shouldRename {

+ 3
- 2
irc/nickserv.go View File

@@ -32,7 +32,8 @@ func servCmdRequiresBouncerEnabled(config *Config) bool {
32 32
 	return config.Accounts.Bouncer.Enabled
33 33
 }
34 34
 
35
-var (
35
+const (
36
+	nsPrefix = "NickServ!NickServ@localhost"
36 37
 	// ZNC's nickserv module will not detect this unless it is:
37 38
 	// 1. sent with prefix `nickserv`
38 39
 	// 2. contains the string "identify"
@@ -267,7 +268,7 @@ information on the settings and their possible values, see HELP SET.`,
267 268
 func nsNotice(rb *ResponseBuffer, text string) {
268 269
 	// XXX i can't figure out how to use OragonoServices[servicename].prefix here
269 270
 	// without creating a compile-time initialization loop
270
-	rb.Add(nil, "NickServ!NickServ@localhost", "NOTICE", rb.target.Nick(), text)
271
+	rb.Add(nil, nsPrefix, "NOTICE", rb.target.Nick(), text)
271 272
 }
272 273
 
273 274
 func nsGetHandler(server *Server, client *Client, command string, params []string, rb *ResponseBuffer) {

Loading…
Cancel
Save