@@ -434,7 +434,9 @@ func (server *Server) playRegistrationBurst(session *Session) {
434434 session .Send (nil , server .name , RPL_MYINFO , d .nick , server .name , Ver , rplMyInfo1 , rplMyInfo2 , rplMyInfo3 )
435435
436436 rb := NewResponseBuffer (session )
437- server .RplISupport (c , rb )
437+ if ! (rb .session .capabilities .Has (caps .ExtendedISupport ) && rb .session .isupportSentPrereg ) {
438+ server .RplISupport (c , rb )
439+ }
438440 if d .account != "" && session .capabilities .Has (caps .Persistence ) {
439441 reportPersistenceStatus (c , rb , false )
440442 }
@@ -456,10 +458,17 @@ func (server *Server) playRegistrationBurst(session *Session) {
456458
457459// RplISupport outputs our ISUPPORT lines to the client. This is used on connection and in VERSION responses.
458460func (server * Server ) RplISupport (client * Client , rb * ResponseBuffer ) {
461+ server .sendRplISupportLines (client , rb , server .Config ().Server .isupport .CachedReply )
462+ }
463+
464+ func (server * Server ) sendRplISupportLines (client * Client , rb * ResponseBuffer , lines [][]string ) {
465+ if rb .session .capabilities .Has (caps .ExtendedISupport ) {
466+ batchID := rb .StartNestedBatch ("chathistory" , caps .ExtendedISupportBatchType )
467+ defer rb .EndNestedBatch (batchID )
468+ }
459469 translatedISupport := client .t ("are supported by this server" )
460470 nick := client .Nick ()
461- config := server .Config ()
462- for _ , cachedTokenLine := range config .Server .isupport .CachedReply {
471+ for _ , cachedTokenLine := range lines {
463472 length := len (cachedTokenLine ) + 2
464473 tokenline := make ([]string , length )
465474 tokenline [0 ] = nick
@@ -794,13 +803,19 @@ func (server *Server) applyConfig(config *Config) (err error) {
794803 }
795804
796805 if ! initial {
797- // push new info to all of our clients
798- for _ , sClient := range server .clients .AllClients () {
799- for _ , tokenline := range newISupportReplies {
800- sClient .Send (nil , server .name , RPL_ISUPPORT , append ([]string {sClient .nick }, tokenline ... )... )
806+ // send 005 updates (somewhat rare)
807+ if len (newISupportReplies ) != 0 {
808+ for _ , sClient := range server .clients .AllClients () {
809+ for _ , session := range sClient .Sessions () {
810+ rb := NewResponseBuffer (session )
811+ server .sendRplISupportLines (sClient , rb , newISupportReplies )
812+ rb .Send (false )
813+ }
801814 }
815+ }
802816
803- if sendRawOutputNotice {
817+ if sendRawOutputNotice {
818+ for _ , sClient := range server .clients .AllClients () {
804819 sClient .Notice (sClient .t ("This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect." ))
805820 }
806821 }
0 commit comments