Changeset 691 in code for trunk/downstream.go
- Timestamp:
- Nov 15, 2021, 11:38:04 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r690 r691 291 291 dc.supportedCaps[k] = v 292 292 } 293 if srv.LogPath != "" { 293 // TODO: this is racy, we should only enable chathistory after 294 // authentication and then check that user.msgStore implements 295 // chatHistoryMessageStore 296 if srv.Config().LogPath != "" { 294 297 dc.supportedCaps["draft/chathistory"] = "" 295 298 } … … 997 1000 } 998 1001 999 if dc.srv.LogPath != ""&& dc.network != nil {1002 if _, ok := dc.user.msgStore.(chatHistoryMessageStore); ok && dc.network != nil { 1000 1003 dc.setSupportedCap("draft/event-playback", "") 1001 1004 } else { … … 1176 1179 isupport = append(isupport, fmt.Sprintf("BOUNCER_NETID=%v", dc.network.ID)) 1177 1180 } 1178 if dc.network == nil && dc.srv.Title != "" {1179 isupport = append(isupport, "NETWORK="+encodeISUPPORT( dc.srv.Title))1181 if title := dc.srv.Config().Title; dc.network == nil && title != "" { 1182 isupport = append(isupport, "NETWORK="+encodeISUPPORT(title)) 1180 1183 } 1181 1184 if dc.network == nil && dc.caps["soju.im/bouncer-networks"] { … … 1205 1208 Prefix: dc.srv.prefix(), 1206 1209 Command: irc.RPL_YOURHOST, 1207 Params: []string{dc.nick, "Your host is " + dc.srv. Hostname},1210 Params: []string{dc.nick, "Your host is " + dc.srv.Config().Hostname}, 1208 1211 }) 1209 1212 dc.SendMessage(&irc.Message{ 1210 1213 Prefix: dc.srv.prefix(), 1211 1214 Command: irc.RPL_MYINFO, 1212 Params: []string{dc.nick, dc.srv. Hostname, "soju", "aiwroO", "OovaimnqpsrtklbeI"},1215 Params: []string{dc.nick, dc.srv.Config().Hostname, "soju", "aiwroO", "OovaimnqpsrtklbeI"}, 1213 1216 }) 1214 1217 for _, msg := range generateIsupport(dc.srv.prefix(), dc.nick, isupport) { … … 1230 1233 } 1231 1234 1232 if motd := dc.user.srv. MOTD(); motd != "" && dc.network == nil {1235 if motd := dc.user.srv.Config().MOTD; motd != "" && dc.network == nil { 1233 1236 for _, msg := range generateMOTD(dc.srv.prefix(), dc.nick, motd) { 1234 1237 dc.SendMessage(msg) … … 1421 1424 destination = msg.Params[1] 1422 1425 } 1423 if destination != "" && destination != dc.srv.Hostname { 1426 hostname := dc.srv.Config().Hostname 1427 if destination != "" && destination != hostname { 1424 1428 return ircError{&irc.Message{ 1425 1429 Command: irc.ERR_NOSUCHSERVER, … … 1430 1434 Prefix: dc.srv.prefix(), 1431 1435 Command: "PONG", 1432 Params: []string{ dc.srv.Hostname, source},1436 Params: []string{hostname, source}, 1433 1437 }) 1434 1438 return nil … … 1947 1951 Username: dc.user.Username, 1948 1952 Hostname: dc.hostname, 1949 Server: dc.srv. Hostname,1953 Server: dc.srv.Config().Hostname, 1950 1954 Nickname: dc.nick, 1951 1955 Flags: flags, … … 1966 1970 Username: servicePrefix.User, 1967 1971 Hostname: servicePrefix.Host, 1968 Server: dc.srv. Hostname,1972 Server: dc.srv.Config().Hostname, 1969 1973 Nickname: serviceNick, 1970 1974 Flags: "H*", … … 2026 2030 Prefix: dc.srv.prefix(), 2027 2031 Command: irc.RPL_WHOISSERVER, 2028 Params: []string{dc.nick, dc.nick, dc.srv. Hostname, "soju"},2032 Params: []string{dc.nick, dc.nick, dc.srv.Config().Hostname, "soju"}, 2029 2033 }) 2030 2034 if dc.user.Admin { … … 2056 2060 Prefix: dc.srv.prefix(), 2057 2061 Command: irc.RPL_WHOISSERVER, 2058 Params: []string{dc.nick, serviceNick, dc.srv. Hostname, "soju"},2062 Params: []string{dc.nick, serviceNick, dc.srv.Config().Hostname, "soju"}, 2059 2063 }) 2060 2064 dc.SendMessage(&irc.Message{ … … 2105 2109 2106 2110 for _, name := range strings.Split(targetsStr, ",") { 2107 if name == "$"+dc.srv. Hostname || (name == "$*" && dc.network == nil) {2111 if name == "$"+dc.srv.Config().Hostname || (name == "$*" && dc.network == nil) { 2108 2112 // "$" means a server mask follows. If it's the bouncer's 2109 2113 // hostname, broadcast the message to all bouncer users.
Note:
See TracChangeset
for help on using the changeset viewer.