- Timestamp:
- Mar 26, 2020, 9:27:46 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bridge.go
r140 r160 10 10 } 11 11 12 sendTopic(dc, ch) 13 14 // TODO: rpl_topicwhotime 15 sendNames(dc, ch) 16 } 17 18 func sendTopic(dc *downstreamConn, ch *upstreamChannel) { 12 19 downstreamName := dc.marshalChannel(ch.conn, ch.Name) 13 20 … … 25 32 }) 26 33 } 27 28 // TODO: rpl_topicwhotime29 sendNames(dc, ch)30 34 } 31 35 -
trunk/downstream.go
r159 r160 1033 1033 }) 1034 1034 } 1035 case "TOPIC": 1036 var channel string 1037 if err := parseMessageParams(msg, &channel); err != nil { 1038 return err 1039 } 1040 1041 uc, upstreamChannel, err := dc.unmarshalEntity(channel) 1042 if err != nil { 1043 return err 1044 } 1045 1046 if len(msg.Params) > 1 { // setting topic 1047 topic := msg.Params[1] 1048 uc.SendMessage(&irc.Message{ 1049 Command: "TOPIC", 1050 Params: []string{upstreamChannel, topic}, 1051 }) 1052 } else { // getting topic 1053 ch, ok := uc.channels[upstreamChannel] 1054 if !ok { 1055 return ircError{&irc.Message{ 1056 Command: irc.ERR_NOSUCHCHANNEL, 1057 Params: []string{dc.nick, upstreamChannel, "No such channel"}, 1058 }} 1059 } 1060 sendTopic(dc, ch) 1061 } 1035 1062 case "NAMES": 1036 1063 if len(msg.Params) == 0 {
Note:
See TracChangeset
for help on using the changeset viewer.