def fromProtocolTreeNode(node): entity = MessageProtocolEntity.fromProtocolTreeNode(node) entity.__class__ = MediaMessageProtocolEntity entity.setMediaType(node.getChild("media").getAttributeValue("type")) preview = node.getChild("media").getData() entity.setPreview(preview) return entity
def fromProtocolTreeNode(node): entity = MessageProtocolEntity.fromProtocolTreeNode(node) entity.__class__ = EncryptedMessageProtocolEntity encNode = node.getChild("enc") entity.setEncProps(encNode["type"], encNode["v"], encNode.data.encode('latin-1') if sys.version_info >= (3,0) else encNode.data) return entity
def fromProtocolTreeNode(node): entity = MessageProtocolEntity.fromProtocolTreeNode(node) entity.__class__ = EncryptedMessageProtocolEntity entity.setEncEntities( [EncProtocolEntity.fromProtocolTreeNode(encNode) for encNode in node.getAllChildren("enc")] ) return entity
def fromProtocolTreeNode(node): entity = MessageProtocolEntity.fromProtocolTreeNode(node) entity.__class__ = EncryptedMessageProtocolEntity entity.setEncEntities([ EncProtocolEntity.fromProtocolTreeNode(encNode) for encNode in node.getAllChildren("enc") ]) return entity