- Timestamp:
- Jun 12, 2020, 12:43:45 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r323 r338 859 859 860 860 uc.appendLog(ch.Name, msg) 861 uc.forEachDownstream(func(dc *downstreamConn) { 862 params := make([]string, len(msg.Params)) 863 params[0] = dc.marshalEntity(uc.network, name) 864 params[1] = modeStr 865 866 copy(params[2:], msg.Params[2:]) 867 for i, modeParam := range params[2:] { 868 if _, ok := needMarshaling[i]; ok { 869 params[2+i] = dc.marshalEntity(uc.network, modeParam) 861 862 if ch, ok := uc.network.channels[name]; !ok || !ch.Detached { 863 uc.forEachDownstream(func(dc *downstreamConn) { 864 params := make([]string, len(msg.Params)) 865 params[0] = dc.marshalEntity(uc.network, name) 866 params[1] = modeStr 867 868 copy(params[2:], msg.Params[2:]) 869 for i, modeParam := range params[2:] { 870 if _, ok := needMarshaling[i]; ok { 871 params[2+i] = dc.marshalEntity(uc.network, modeParam) 872 } 870 873 } 871 } 872 873 dc.SendMessage(&irc.Message{874 Prefix: dc.marshalUserPrefix(uc.network, msg.Prefix),875 Command: "MODE",876 Params: params,874 875 dc.SendMessage(&irc.Message{ 876 Prefix: dc.marshalUserPrefix(uc.network, msg.Prefix), 877 Command: "MODE", 878 Params: params, 879 }) 877 880 }) 878 } )881 } 879 882 } 880 883 case irc.RPL_UMODEIS: … … 913 916 } 914 917 if firstMode { 915 modeStr, modeParams := ch.modes.Format() 916 917 uc.forEachDownstream(func(dc *downstreamConn) { 918 params := []string{dc.nick, dc.marshalEntity(uc.network, channel), modeStr} 919 params = append(params, modeParams...) 920 921 dc.SendMessage(&irc.Message{ 922 Prefix: dc.srv.prefix(), 923 Command: irc.RPL_CHANNELMODEIS, 924 Params: params, 918 if c, ok := uc.network.channels[channel]; !ok || !c.Detached { 919 modeStr, modeParams := ch.modes.Format() 920 921 uc.forEachDownstream(func(dc *downstreamConn) { 922 params := []string{dc.nick, dc.marshalEntity(uc.network, channel), modeStr} 923 params = append(params, modeParams...) 924 925 dc.SendMessage(&irc.Message{ 926 Prefix: dc.srv.prefix(), 927 Command: irc.RPL_CHANNELMODEIS, 928 Params: params, 929 }) 925 930 }) 926 } )931 } 927 932 } 928 933 case rpl_creationtime: … … 1049 1054 ch.complete = true 1050 1055 1051 uc.forEachDownstream(func(dc *downstreamConn) { 1052 forwardChannel(dc, ch) 1053 }) 1056 if c, ok := uc.network.channels[name]; !ok || !c.Detached { 1057 uc.forEachDownstream(func(dc *downstreamConn) { 1058 forwardChannel(dc, ch) 1059 }) 1060 } 1054 1061 case irc.RPL_WHOREPLY: 1055 1062 var channel, username, host, server, nick, mode, trailing string
Note:
See TracChangeset
for help on using the changeset viewer.