Пример #1
0
	def handleVCardPayload(self, data):
		payload = protocol_pb2.VCard()
		if (payload.ParseFromString(data) == False):
			#TODO: ERROR
			return
		if payload.HasField('photo'):
			self.handleVCardUpdatedRequest(payload.userName, payload.photo, payload.nickname)
		elif len(payload.buddyName)  > 0:
			self.handleVCardRequest(payload.userName, payload.buddyName, payload.id)
Пример #2
0
	def handleVCard(self, user, ID, legacyName, fullName, nickname, photo):
		vcard = protocol_pb2.VCard()
		vcard.userName = user
		vcard.buddyName = legacyName
		vcard.id = ID
		vcard.fullname = fullName
		vcard.nickname = nickname
		vcard.photo = photo 

		message = WRAP(vcard.SerializeToString(), protocol_pb2.WrapperMessage.TYPE_VCARD)
		self.send(message)