diff options
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 |