diff --git a/webinterface.py b/webinterface.py index c38dc20a..2be77922 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2565,6 +2565,187 @@ def postIsMuted(baseDir: str,nickname: str,domain: str, \ return True return False +def getPostAttachmentsAsHtml(postJsonObject: {},boxName: str,translate: {}, \ + isMuted: bool, \ + replyStr: str,announceStr: str,likeStr: str, \ + bookmarkStr: str,deleteStr: str,muteStr: str) -> (str,str): + """Returns a string representing any attachments + """ + attachmentStr='' + galleryStr='' + if not postJsonObject['object'].get('attachment'): + return attachmentStr,galleryStr + + if not isinstance(postJsonObject['object']['attachment'], list): + return attachmentStr,galleryStr + + attachmentCtr=0 + attachmentStr+='