diff --git a/daemon.py b/daemon.py index 1afd1e58..d2286148 100644 --- a/daemon.py +++ b/daemon.py @@ -5205,6 +5205,9 @@ class PubServer(BaseHTTPRequestHandler): except BaseException: pass + mentionsStr = '' + if fields.get('mentions'): + mentionsStr = fields['mentions'].strip() + ' ' if postType == 'newpost': messageJson = \ createPublicPost(self.server.baseDir, @@ -5212,7 +5215,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.domain, self.server.port, self.server.httpPrefix, - fields['message'], + mentionsStr + fields['message'], False, False, False, filename, attachmentMediaType, fields['imageDescription'], @@ -5341,7 +5344,7 @@ class PubServer(BaseHTTPRequestHandler): nickname, self.server.domain, self.server.port, self.server.httpPrefix, - fields['message'], + mentionsStr + fields['message'], False, False, False, filename, attachmentMediaType, fields['imageDescription'], @@ -5373,7 +5376,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.domain, self.server.port, self.server.httpPrefix, - fields['message'], + mentionsStr + fields['message'], True, False, False, filename, attachmentMediaType, fields['imageDescription'], @@ -5401,13 +5404,14 @@ class PubServer(BaseHTTPRequestHandler): elif postType == 'newdm': messageJson = None print('A DM was posted') - if '@' in fields['message']: + if '@' in mentionsStr: messageJson = \ createDirectMessagePost(self.server.baseDir, nickname, self.server.domain, self.server.port, self.server.httpPrefix, + mentionsStr + fields['message'], True, False, False, filename, attachmentMediaType, @@ -5440,15 +5444,15 @@ class PubServer(BaseHTTPRequestHandler): messageJson = None handle = nickname + '@' + self.server.domainFull print('A reminder was posted for ' + handle) - if '@' + handle not in fields['message']: - fields['message'] = '@' + handle + ' ' + fields['message'] + if '@' + handle not in mentionsStr: + mentionsStr = '@' + handle + ' ' + mentionsStr messageJson = \ createDirectMessagePost(self.server.baseDir, nickname, self.server.domain, self.server.port, self.server.httpPrefix, - fields['message'], + mentionsStr + fields['message'], True, False, False, filename, attachmentMediaType, fields['imageDescription'], @@ -5481,7 +5485,7 @@ class PubServer(BaseHTTPRequestHandler): nickname, self.server.domain, self.server.port, self.server.httpPrefix, - fields['message'], + mentionsStr + fields['message'], True, False, False, filename, attachmentMediaType, fields['imageDescription'], diff --git a/translations/ar.json b/translations/ar.json index 1701f321..b93da7f5 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -234,5 +234,6 @@ "Henge": "هنج", "QR Code": "رمز الاستجابة السريعة", "Reminder": "تذكير", - "Scheduled note to yourself": "ملاحظة مجدولة لنفسك" + "Scheduled note to yourself": "ملاحظة مجدولة لنفسك", + "Replying to": "الرد على" } diff --git a/translations/ca.json b/translations/ca.json index 08062ab3..51c2428b 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "Codi QR", "Reminder": "Recordatori", - "Scheduled note to yourself": "Nota programada a tu mateix" + "Scheduled note to yourself": "Nota programada a tu mateix", + "Replying to": "Responent a" } diff --git a/translations/cy.json b/translations/cy.json index de620ae9..9ab203e1 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "Cod QR", "Reminder": "Nodyn atgoffa", - "Scheduled note to yourself": "Nodyn wedi'i drefnu i chi'ch hun" + "Scheduled note to yourself": "Nodyn wedi'i drefnu i chi'ch hun", + "Replying to": "Ymateb i" } diff --git a/translations/de.json b/translations/de.json index 9b6c8146..fb483665 100644 --- a/translations/de.json +++ b/translations/de.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "QR-Code", "Reminder": "Erinnerung", - "Scheduled note to yourself": "Geplante Notiz an dich" + "Scheduled note to yourself": "Geplante Notiz an dich", + "Replying to": "Antworten auf" } diff --git a/translations/en.json b/translations/en.json index 3a099eaf..9359eeeb 100644 --- a/translations/en.json +++ b/translations/en.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "QR Code", "Reminder": "Reminder", - "Scheduled note to yourself": "Scheduled note to yourself" + "Scheduled note to yourself": "Scheduled note to yourself", + "Replying to": "Replying to" } diff --git a/translations/es.json b/translations/es.json index 531daada..9fd9dde8 100644 --- a/translations/es.json +++ b/translations/es.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "Código QR", "Reminder": "Recordatorio", - "Scheduled note to yourself": "Nota programada para ti" + "Scheduled note to yourself": "Nota programada para ti", + "Replying to": "Respondiendo a" } diff --git a/translations/fr.json b/translations/fr.json index 0f5be6db..44e8ebe5 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "QR Code", "Reminder": "Rappel", - "Scheduled note to yourself": "Note programmée pour vous" + "Scheduled note to yourself": "Note programmée pour vous", + "Replying to": "Répondre à" } diff --git a/translations/ga.json b/translations/ga.json index 37c80123..3728f21d 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "Cód QR", "Reminder": "Meabhrúchán", - "Scheduled note to yourself": "Nóta sceidealta duit féin" + "Scheduled note to yourself": "Nóta sceidealta duit féin", + "Replying to": "Ag freagairt do" } diff --git a/translations/hi.json b/translations/hi.json index 9ca5ed9b..34c30cc2 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -234,5 +234,6 @@ "Henge": "हेंगे", "QR Code": "क्यूआर कोड", "Reminder": "अनुस्मारक", - "Scheduled note to yourself": "खुद को निर्धारित नोट" + "Scheduled note to yourself": "खुद को निर्धारित नोट", + "Replying to": "को जवाब दे रहा है" } diff --git a/translations/it.json b/translations/it.json index 0cea4960..9241cc7a 100644 --- a/translations/it.json +++ b/translations/it.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "QR Code", "Reminder": "Promemoria", - "Scheduled note to yourself": "Nota programmata per te" + "Scheduled note to yourself": "Nota programmata per te", + "Replying to": "In risposta a" } diff --git a/translations/ja.json b/translations/ja.json index 2b183341..6483369c 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -234,5 +234,6 @@ "Henge": "ヘンゲ", "QR Code": "QRコード", "Reminder": "リマインダー", - "Scheduled note to yourself": "自分への予定されたメモ" + "Scheduled note to yourself": "自分への予定されたメモ", + "Replying to": "に返信しています" } diff --git a/translations/oc.json b/translations/oc.json index 6030ac42..eb1c9735 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -230,5 +230,6 @@ "Henge": "Henge", "QR Code": "QR Code", "Reminder": "Reminder", - "Scheduled note to yourself": "Scheduled note to yourself" + "Scheduled note to yourself": "Scheduled note to yourself", + "Replying to": "Replying to" } diff --git a/translations/pt.json b/translations/pt.json index 9827d1aa..d52d13be 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -234,5 +234,6 @@ "Henge": "Henge", "QR Code": "Código QR", "Reminder": "Lembrete", - "Scheduled note to yourself": "Nota agendada para si mesmo" + "Scheduled note to yourself": "Nota agendada para si mesmo", + "Replying to": "Respondendo a" } diff --git a/translations/ru.json b/translations/ru.json index b46c0524..bf124ce0 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -234,5 +234,6 @@ "Henge": "Хендж", "QR Code": "QR код", "Reminder": "напоминание", - "Scheduled note to yourself": "Запланированная заметка для себя" + "Scheduled note to yourself": "Запланированная заметка для себя", + "Replying to": "Отвечать на" } diff --git a/translations/zh.json b/translations/zh.json index cc4ce048..09656593 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -233,5 +233,6 @@ "Henge": "亨格", "QR Code": "二维码", "Reminder": "提醒", - "Scheduled note to yourself": "预定给自己的笔记" + "Scheduled note to yourself": "预定给自己的笔记", + "Replying to": "回覆" } diff --git a/webinterface.py b/webinterface.py index 938a556c..26c9a2b7 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1798,6 +1798,11 @@ def htmlNewPost(mediaInstance: bool, translate: {}, scopeDescription = translate['Public'] placeholderSubject = \ translate['Subject or Content Warning (optional)'] + '...' + placeholderMentions = '' + if inReplyTo: + # mentionsAndContent = getMentionsString(content) + placeholderMentions = \ + translate['Replying to'] + '...' placeholderMessage = translate['Write something'] + '...' extraFields = '' endpoint = 'newpost' @@ -2070,10 +2075,20 @@ def htmlNewPost(mediaInstance: bool, translate: {}, newPostForm += replyStr if mediaInstance and not replyStr: newPostForm += newPostImageSection + newPostForm += \ '
' newPostForm += ' ' newPostForm += '' + + if inReplyTo: + newPostForm += \ + '
' + newPostForm += \ + ' ' + newPostForm += '' + newPostForm += \ '
' messageBoxHeight = 400 @@ -2087,7 +2102,7 @@ def htmlNewPost(mediaInstance: bool, translate: {}, newPostForm += \ ' \n' + str(messageBoxHeight) + 'px">\n' newPostForm += extraFields+dateAndLocation if not mediaInstance or replyStr: newPostForm += newPostImageSection @@ -2095,8 +2110,6 @@ def htmlNewPost(mediaInstance: bool, translate: {}, newPostForm += '\n' if not reportUrl: - newPostForm += \ - '' newPostForm = \ newPostForm.replace('', '') @@ -2743,27 +2756,6 @@ def individualFollowAsHtml(translate: {}, return resultStr -def cursorToEndOfMessageScript() -> str: - """Moves the cursor to the end of the text in a textarea - This avoids the cursor being in the wrong position when replying - """ - script = 'function focusOnMessage() {\n' - script += " var replyTextArea=document.getElementById('message');\n" - script += ' val=replyTextArea.value;\n' - script += ' if ((val.length>0) && (val.charAt(val.length-1) != " ")) {\n' - script += ' val += " ";\n' - script += ' }\n' - script += ' replyTextArea.focus();\n' - script += ' replyTextArea.value="";\n' - script += ' replyTextArea.value=val;\n' - script += '}\n' - script += "var replyTextArea=document.getElementById('message')\n" - script += 'replyTextArea.onFocus=function() {\n' - script += ' focusOnMessage();' - script += '}\n' - return script - - def addEmbeddedAudio(translate: {}, content: str) -> str: """Adds embedded audio for mp3/ogg """