Skip to content

Commit

Permalink
[fix] fix Document entity construction
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalal committed Jun 4, 2019
1 parent b957249 commit 08a4fe4
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
from .message_media_downloadable import DownloadableMediaMessageProtocolEntity
from yowsup.layers.protocol_messages.protocolentities.attributes.attributes_downloadablemedia \
import DownloadableMediaMessageAttributes
from yowsup.layers.protocol_messages.protocolentities.attributes.attributes_message_meta import MessageMetaAttributes
from yowsup.layers.protocol_messages.protocolentities.attributes.attributes_document import DocumentAttributes
from yowsup.layers.protocol_messages.protocolentities.attributes.attributes_message import MessageAttributes


class DocumentDownloadableMediaMessageProtocolEntity(DownloadableMediaMessageProtocolEntity):
def __init__(self, document_attrs, downloadablemedia_attrs, message_meta_attrs):
def __init__(self, document_attrs, message_meta_attrs):
"""
:type document_attrs: DocumentAttributes
:type downloadablemedia_attrs: DownloadableMediaMessageAttributes
:type message_meta_attrs: MessageMetaAttributes
"""
super(DocumentDownloadableMediaMessageProtocolEntity, self).__init__(
"document", downloadablemedia_attrs, message_meta_attrs
"document", MessageAttributes(document=document_attrs), message_meta_attrs
)
self.file_name = document_attrs.file_name
self.file_length = document_attrs.file_length
if document_attrs.title is not None:
self.title = document_attrs.title
if document_attrs.page_count is not None:
self.page_count = document_attrs.page_count
if document_attrs.jpeg_thumbnail is not None:
self.jpeg_thumbnail = document_attrs.jpeg_thumbnail

@property
def media_specific_attributes(self):
Expand Down

0 comments on commit 08a4fe4

Please sign in to comment.