diff options
author | Ben Harris <ben@tilde.team> | 2020-05-14 17:13:46 -0400 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2020-05-14 17:13:46 -0400 |
commit | aef26a40cbc6835aae0d293a523f5a7681b9a436 (patch) | |
tree | 38bce3840a24d3a83e3243a64462ccab99bfdf76 /IrcStates/ISupport.cs | |
parent | a0fbcf83c57d15bf4bbdd2f18a8b8d539e3e4a1a (diff) |
wow lots of tests passing!
Diffstat (limited to 'IrcStates/ISupport.cs')
-rw-r--r-- | IrcStates/ISupport.cs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/IrcStates/ISupport.cs b/IrcStates/ISupport.cs index 2fc27dc..db2f537 100644 --- a/IrcStates/ISupport.cs +++ b/IrcStates/ISupport.cs @@ -16,6 +16,7 @@ namespace IrcStates CaseMapping = Casemap.CaseMapping.Rfc1459; Prefix = new ISupportPrefix("(ov)@+"); ChanModes = new ISupportChanModes("b,k,l,imnpst"); + ChanTypes = new List<string> {"#"}; StatusMsg = new List<string>(); Whox = false; } @@ -46,10 +47,14 @@ namespace IrcStates { var split = token.Split('=', 2); var key = split[0]; - var value = split[1]; - - if (split.Length > 1) Raw[key] = value; + var value = string.Empty; + if (split.Length > 1) + { + value = split[1]; + Raw[key] = value; + } + switch (split[0]) { case "NETWORK": @@ -62,7 +67,8 @@ namespace IrcStates Prefix = new ISupportPrefix(value); break; case "STATUSMSG": - StatusMsg = new List<string> {value}; + StatusMsg = new List<string>(); + StatusMsg.AddRange(value.Select(c => c.ToString(CultureInfo.InvariantCulture))); break; case "MODES": Modes = int.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture); @@ -77,16 +83,17 @@ namespace IrcStates if (Enum.TryParse(value, true, out Casemap.CaseMapping caseMapping)) CaseMapping = caseMapping; break; case "CHANTYPES": - ChanTypes = new List<string> {value}; + ChanTypes = new List<string>(); + ChanTypes.AddRange(value.Select(c => c.ToString(CultureInfo.InvariantCulture))); break; case "CALLERID": - CallerId = string.IsNullOrEmpty(value) ? value : "g"; + CallerId = string.IsNullOrEmpty(value) ? "g" : value; break; case "EXCEPTS": - Excepts = string.IsNullOrEmpty(value) ? value : "e"; + Excepts = string.IsNullOrEmpty(value) ? "e" : value; break; case "INVEX": - Invex = string.IsNullOrEmpty(value) ? value : "I"; + Invex = string.IsNullOrEmpty(value) ? "I" : value; break; case "WHOX": Whox = true; |