Commits

Jason R. Coombs committed db8d2da

Use NickMask class for constructing the client_ident

  • Participants
  • Parent commits aba1251

Comments (0)

Files changed (2)

File irc/client.py

     """
     A nickmask (the source of an Event)
     """
+    @classmethod
+    def from_params(cls, nick, user, host):
+        return cls('{nick}!{user}@{host}'.format(**vars()))
+
     @property
     def nick(self):
         return self.split("!")[0]

File irc/server.py

         """
         Return the client identifier as included in many command replies.
         """
-        return '%s!%s@%s' % (self.nick, self.user, self.server.servername)
+        return client.NickMask.from_params(self.nick, self.user,
+            self.server.servername)
 
     def finish(self):
         """