Changeset 759 in code
- Timestamp:
- Dec 9, 2021, 11:12:20 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r757 r759 1156 1156 return err 1157 1157 } 1158 if firstMode { 1159 c := uc.network.channels.Value(channel) 1160 if c == nil || !c.Detached { 1161 modeStr, modeParams := ch.modes.Format() 1162 1163 uc.forEachDownstream(func(dc *downstreamConn) { 1164 params := []string{dc.nick, dc.marshalEntity(uc.network, channel), modeStr} 1165 params = append(params, modeParams...) 1166 1167 dc.SendMessage(&irc.Message{ 1168 Prefix: dc.srv.prefix(), 1169 Command: irc.RPL_CHANNELMODEIS, 1170 Params: params, 1171 }) 1158 1159 c := uc.network.channels.Value(channel) 1160 if firstMode && (c == nil || !c.Detached) { 1161 modeStr, modeParams := ch.modes.Format() 1162 1163 uc.forEachDownstream(func(dc *downstreamConn) { 1164 params := []string{dc.nick, dc.marshalEntity(uc.network, channel), modeStr} 1165 params = append(params, modeParams...) 1166 1167 dc.SendMessage(&irc.Message{ 1168 Prefix: dc.srv.prefix(), 1169 Command: irc.RPL_CHANNELMODEIS, 1170 Params: params, 1172 1171 }) 1173 } 1172 }) 1174 1173 } 1175 1174 case rpl_creationtime: … … 1186 1185 firstCreationTime := ch.creationTime == "" 1187 1186 ch.creationTime = creationTime 1188 if firstCreationTime { 1187 1188 c := uc.network.channels.Value(channel) 1189 if firstCreationTime && (c == nil || !c.Detached) { 1189 1190 uc.forEachDownstream(func(dc *downstreamConn) { 1190 1191 dc.SendMessage(&irc.Message{ … … 1196 1197 } 1197 1198 case rpl_topicwhotime: 1198 var name, who, timeStr string 1199 if err := parseMessageParams(msg, nil, &name, &who, &timeStr); err != nil { 1200 return err 1201 } 1202 ch, err := uc.getChannel(name) 1199 var channel, who, timeStr string 1200 if err := parseMessageParams(msg, nil, &channel, &who, &timeStr); err != nil { 1201 return err 1202 } 1203 1204 ch, err := uc.getChannel(channel) 1203 1205 if err != nil { 1204 1206 return err 1205 1207 } 1208 1206 1209 firstTopicWhoTime := ch.TopicWho == nil 1207 1210 ch.TopicWho = irc.ParsePrefix(who) … … 1211 1214 } 1212 1215 ch.TopicTime = time.Unix(sec, 0) 1213 if firstTopicWhoTime { 1216 1217 c := uc.network.channels.Value(channel) 1218 if firstTopicWhoTime && (c == nil || !c.Detached) { 1214 1219 uc.forEachDownstream(func(dc *downstreamConn) { 1215 1220 topicWho := dc.marshalUserPrefix(uc.network, ch.TopicWho)
Note:
See TracChangeset
for help on using the changeset viewer.