Attaching documents is now supported

This commit is contained in:
2019-01-28 05:36:51 -06:00
parent 94902c661f
commit ac268c0672
5 changed files with 65 additions and 12 deletions

View File

@@ -63,6 +63,16 @@ class attachPresenter(base.basePresenter):
self.send_message("insert_attachment", attachment=info)
self.send_message("enable_control", control="remove")
def upload_document(self, document):
""" allows uploading a document from the computer.
"""
doc_info = {"type": "document", "file": document, "from": "local", "title": os.path.basename(os.path.splitext(document)[0])}
self.attachments.append(doc_info)
# Translators: This is the text displayed in the attachments dialog, when the user adds a document.
info = [_("Document"), os.path.basename(document)]
self.send_message("insert_attachment", attachment=info)
self.send_message("enable_control", control="remove")
def upload_voice_message(self):
a = audioRecorder.audioRecorderPresenter(view=views.audioRecorderDialog(), interactor=interactors.audioRecorderInteractor())
if a.file != None and a.duration != 0: