Ejemplo n.º 1
0
	def _311(server, raw_string, code, server_url, target, data): #whoisuser
		data = data.split(None, 4)
		whois = server.getStash().getWhoIs(data[0])
		if not whois:
			whois = server.getStash().createWhoIs(data[0])
			
		user = server.getUser(data[0])
		if user:
			user.setIdentity(data[1], data[2])
			user.setRealname(data[4])
			whois['userdata'] = user.getData()
		else:
			whois['userdata'] = informationDictionaries.User_Data(data[0], data[1], data[2], tld_table.tldLookup(data[2]), data[4], None, None, None, None)
Ejemplo n.º 2
0
def generateUserData(user_data):
	"""
	This function takes a (nickname, ident, hostmask) tuple and uses it to
	generate a "User Data" dictionary.
	
	@type user_data: tuple
	@param user_data: A tuple of the following form::
	     (<nickname:unicode>, <ident:unicode|None>, <hostmask:unicode|None>)
	
	@rtype: dict
	@return: A dictionary of the form returned by
	    common.dictionaries.information.User_Data().
	"""
	country = None
	if user_data[2]:
		country = tld_table.tldLookup(user_data[2])
		
	return informationDictionaries.User_Data(user_data[0], user_data[1], user_data[2], country, None, None, None, None, None)
	
Ejemplo n.º 3
0
	def _600_601_604_605(server, raw_string, code, server_url, target, data): #logon, logoff, nowon, nowoff
		data = data.split()
		type = None
		if code == 600:
			type = u'logon'
		elif code == 601:
			type = u'logoff'
		elif code == 604:
			type = u'nowon'
		elif code == 605:
			type = u'nowoff'
			
		user_data = None
		user = server.getUser(data[0])
		if user:
			user.setIdentity(data[1], data[2])
			user_data = user.getData()
		else:
			user_data = informationDictionaries.User_Data(data[0], data[1], data[2], tld_table.tldLookup(data[2]), None, None, None, None, None)
		server.addEvent(outboundDictionaries.IRC_User_Logon(server.getContextID(), server.getName(), type, int(data[3]), data[4][1:], user_data))
Ejemplo n.º 4
0
	def _314(server, raw_string, code, server_url, target, data): #whowasuser
		data = data.split(None, 4)
		whowas = server.getStash().createWhoWas(data[0])
		whowas['userdata'] = informationDictionaries.User_Data(data[0], data[1], data[2], tld_table.tldLookup(data[2]), data[4][1:], None, None, None, None)