diff options
author | Ben Harris <ben@tilde.team> | 2020-04-20 17:24:59 -0400 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2020-04-20 17:24:59 -0400 |
commit | 6a3bfd314d87bed96611d24440b0961a06bf7e91 (patch) | |
tree | 5652d9ab48d850b7c9bd905b49b6d2709ae849c8 /IrcTokens/Hostmask.cs | |
parent | 616abc70303990fbf8096fc6ada5fac100a6c66a (diff) |
stateful in progress
Diffstat (limited to 'IrcTokens/Hostmask.cs')
-rw-r--r-- | IrcTokens/Hostmask.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/IrcTokens/Hostmask.cs b/IrcTokens/Hostmask.cs index 05470ef..9f935b0 100644 --- a/IrcTokens/Hostmask.cs +++ b/IrcTokens/Hostmask.cs @@ -11,8 +11,18 @@ public override string ToString() => _source; + public override int GetHashCode() => _source.GetHashCode(); + + public override bool Equals(object obj) + { + if (obj == null || GetType() != obj.GetType()) + return false; + + return _source == ((Hostmask) obj)._source; + } + private readonly string _source; - + public Hostmask(string source) { if (source == null) return; @@ -30,7 +40,7 @@ { NickName = source; } - + if (NickName.Contains('!')) { var userSplit = NickName.Split('!'); @@ -39,4 +49,4 @@ } } } -} +} \ No newline at end of file |