Sfoglia il codice sorgente

Set default user modes when always-on clients reconnect.

Add default-user-modes configuration to conventional.yaml.
Fix comment on DefaultUserModes.
tags/v2.1.0-rc1
Alex Jaspersen 4 anni fa
parent
commit
b3a7e5c996
3 ha cambiato i file con 11 aggiunte e 1 eliminazioni
  1. 6
    0
      conventional.yaml
  2. 4
    0
      irc/client.go
  3. 1
    1
      irc/modes.go

+ 6
- 0
conventional.yaml Vedi File

@@ -430,6 +430,12 @@ accounts:
430 430
         offer-list:
431 431
             #- "oragono.test"
432 432
 
433
+    # modes that are set by default when a user connects
434
+    # if unset, no user modes will be set by default
435
+    # +i is invisible (a user's channels are hidden from whois replies)
436
+    # see  /QUOTE HELP umodes  for more user modes
437
+    # default-user-modes: +i
438
+
433 439
     # support for deferring password checking to an external LDAP server
434 440
     # you should probably ignore this section! consult the grafana docs for details:
435 441
     # https://grafana.com/docs/grafana/latest/auth/ldap/

+ 4
- 0
irc/client.go Vedi File

@@ -375,6 +375,10 @@ func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string,
375 375
 		alwaysOn: true,
376 376
 	}
377 377
 
378
+	for _, defaultMode := range config.Accounts.defaultUserModes {
379
+		client.SetMode(defaultMode, true)
380
+	}
381
+
378 382
 	client.SetMode(modes.TLS, true)
379 383
 	client.writerSemaphore.Initialize(1)
380 384
 	client.history.Initialize(0, 0)

+ 1
- 1
irc/modes.go Vedi File

@@ -22,7 +22,7 @@ var (
22 22
 	}
23 23
 
24 24
 	// DefaultUserModes are set on all users when they login.
25
-	// this can be overridden in the `server` config, with the `default-user-modes` key
25
+	// this can be overridden in the `accounts` config, with the `default-user-modes` key
26 26
 	DefaultUserModes = modes.Modes{}
27 27
 )
28 28
 

Loading…
Annulla
Salva