def handleFTStartPayload(self, data): payload = protocol_pb2.File() if (payload.ParseFromString(data) == False): #TODO: ERROR return self.handleFTStartRequest(payload.userName, payload.buddyName, payload.fileName, payload.size, payload.ftID)
def handleFTStart(self, user, buddyName, fileName, size): room = protocol_pb2.File() room.userName = user room.buddyName = buddyName room.fileName = fileName room.size = size message = WRAP(room.SerializeToString(), protocol_pb2.WrapperMessage.TYPE_FT_START) self.send(message);
def handleFTFinish(self, user, buddyName, fileName, size, ftid): room = protocol_pb2.File() room.userName = user room.buddyName = buddyName room.fileName = fileName room.size = size # Check later if ftid != 0: room.ftID = ftid message = WRAP(room.SerializeToString(), protocol_pb2.WrapperMessage.TYPE_FT_FINISH) self.send(message)