Changeset 534 in code for trunk/downstream.go
- Timestamp:
- May 25, 2021, 2:42:51 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r533 r534 1994 1994 1995 1995 attrs := irc.Tags{ 1996 "name": irc.TagValue(network.GetName()), 1997 "state": irc.TagValue(state), 1996 "name": irc.TagValue(network.GetName()), 1997 "state": irc.TagValue(state), 1998 "nickname": irc.TagValue(network.Nick), 1999 } 2000 2001 if network.Username != "" { 2002 attrs["username"] = irc.TagValue(network.Username) 2003 } 2004 if network.Realname != "" { 2005 attrs["realname"] = irc.TagValue(network.Realname) 2006 } 2007 2008 if u, err := network.URL(); err == nil { 2009 hasHostPort := true 2010 switch u.Scheme { 2011 case "ircs": 2012 attrs["tls"] = irc.TagValue("1") 2013 case "irc+insecure": 2014 attrs["tls"] = irc.TagValue("0") 2015 default: 2016 hasHostPort = false 2017 } 2018 if host, port, err := net.SplitHostPort(u.Host); err == nil && hasHostPort { 2019 attrs["host"] = irc.TagValue(host) 2020 attrs["port"] = irc.TagValue(port) 2021 } else if hasHostPort { 2022 attrs["host"] = irc.TagValue(u.Host) 2023 } 1998 2024 } 1999 2025
Note:
See TracChangeset
for help on using the changeset viewer.