about summary refs log tree commit diff
path: root/IrcTokens/Hostmask.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-04-20 17:24:59 -0400
committerBen Harris <ben@tilde.team>2020-04-20 17:24:59 -0400
commit6a3bfd314d87bed96611d24440b0961a06bf7e91 (patch)
tree5652d9ab48d850b7c9bd905b49b6d2709ae849c8 /IrcTokens/Hostmask.cs
parent616abc70303990fbf8096fc6ada5fac100a6c66a (diff)
stateful in progress
Diffstat (limited to 'IrcTokens/Hostmask.cs')
-rw-r--r--IrcTokens/Hostmask.cs16
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