Changeset 177 in code for trunk/downstream.go
- Timestamp:
- Mar 27, 2020, 11:07:20 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r176 r177 1078 1078 sendTopic(dc, ch) 1079 1079 } 1080 case "LIST": 1081 // TODO: support ELIST when supported by all upstreams 1082 1083 dc.user.pendingLISTsLock.Lock() 1084 defer dc.user.pendingLISTsLock.Unlock() 1085 1086 pl := pendingLIST{ 1087 downstreamID: dc.id, 1088 pendingCommands: make(map[int64]*irc.Message), 1089 } 1090 var upstreamChannels map[int64][]string 1091 if len(msg.Params) > 0 { 1092 upstreamChannels = make(map[int64][]string) 1093 channels := strings.Split(msg.Params[0], ",") 1094 for _, channel := range channels { 1095 uc, upstreamChannel, err := dc.unmarshalEntity(channel) 1096 if err != nil { 1097 return err 1098 } 1099 upstreamChannels[uc.network.ID] = append(upstreamChannels[uc.network.ID], upstreamChannel) 1100 } 1101 } 1102 1103 dc.user.pendingLISTs = append(dc.user.pendingLISTs, pl) 1104 dc.forEachUpstream(func(uc *upstreamConn) { 1105 var params []string 1106 if upstreamChannels != nil { 1107 if channels, ok := upstreamChannels[uc.network.ID]; ok { 1108 params = []string{strings.Join(channels, ",")} 1109 } else { 1110 return 1111 } 1112 } 1113 pl.pendingCommands[uc.network.ID] = &irc.Message{ 1114 Command: "LIST", 1115 Params: params, 1116 } 1117 uc.trySendList(dc.id) 1118 }) 1080 1119 case "NAMES": 1081 1120 if len(msg.Params) == 0 {
Note:
See TracChangeset
for help on using the changeset viewer.