def do_nickname(self,nick): if '#' in nick: nick = nick.strip() i = nick.index('#') trip = util.tripcode(nick[:i],nick[i+1:]) nick = util.filter_unicode(nick[:i]) for c in nick: if c in self._bad_chars: return self._rand_nick(6) nick += '|' return nick + trip[:len(trip)/2] return self._rand_nick(6)
def do_nickname(self,nick): if '#' in nick and nick[0] != '#': i = nick.index('#') trip = util.tripcode(nick[:i],nick[i+1:]) nick = nick[:i] nick += '|' nick += trip[:len(trip)/2] else: nick = self._rand_nick(6) while self.server.has_user(nick): nick = self._rand_nick(6) return nick
def make_trip(name,code): trip = util.tripcode(name,code) l = len(trip) return '%s|%s' % ( name,trip[:l/2] )
def hash_trip(self,name,trip): return tripcode(name,trip)