mirror of
https://github.com/markqvist/Sideband.git
synced 2025-08-15 09:45:34 -04:00
Added image and file attachment sending
This commit is contained in:
parent
8f8c1ec68f
commit
7f891d68e0
2 changed files with 269 additions and 48 deletions
|
@ -3244,7 +3244,7 @@ class SidebandCore():
|
|||
RNS.log("Error while creating paper message: "+str(e), RNS.LOG_ERROR)
|
||||
return False
|
||||
|
||||
def send_message(self, content, destination_hash, propagation, skip_fields=False, no_display=False):
|
||||
def send_message(self, content, destination_hash, propagation, skip_fields=False, no_display=False, attachment = None, image = None, audio = None):
|
||||
try:
|
||||
if content == "":
|
||||
raise ValueError("Message content cannot be empty")
|
||||
|
@ -3263,6 +3263,11 @@ class SidebandCore():
|
|||
else:
|
||||
fields = self.get_message_fields(destination_hash)
|
||||
|
||||
if attachment != None:
|
||||
fields[LXMF.FIELD_FILE_ATTACHMENTS] = [attachment]
|
||||
if image != None:
|
||||
fields[LXMF.FIELD_IMAGE] = image
|
||||
|
||||
lxm = LXMF.LXMessage(dest, source, content, title="", desired_method=desired_method, fields = fields)
|
||||
|
||||
if not no_display:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue