diff --git a/daemon.py b/daemon.py index 03e142f31..8eff2e7bf 100644 --- a/daemon.py +++ b/daemon.py @@ -5708,6 +5708,32 @@ class PubServer(BaseHTTPRequestHandler): notifyLikesFilename) pass + notifyReactionsFilename = \ + acctDir(baseDir, nickname, domain) + \ + '/.notifyReactions' + if onFinalWelcomeScreen: + # default setting from welcome screen + with open(notifyReactionsFilename, 'w+') as rFile: + rFile.write('\n') + actorChanged = True + else: + notifyReactionsActive = False + if fields.get('notifyReactions'): + if fields['notifyReactions'] == 'on': + notifyReactionsActive = True + with open(notifyReactionsFilename, + 'w+') as rFile: + rFile.write('\n') + if not notifyReactionsActive: + if os.path.isfile(notifyReactionsFilename): + try: + os.remove(notifyReactionsFilename) + except BaseException: + print('EX: _profileUpdate ' + + 'unable to delete ' + + notifyReactionsFilename) + pass + # this account is a bot if fields.get('isBot'): if fields['isBot'] == 'on': diff --git a/inbox.py b/inbox.py index 8d45aeff4..a2bbdf81d 100644 --- a/inbox.py +++ b/inbox.py @@ -2460,7 +2460,7 @@ def _reactionNotify(baseDir: str, domain: str, onionDomain: str, accountDir = baseDir + '/accounts/' + handle # are reaction notifications enabled? - notifyReactionEnabledFilename = accountDir + '/.notifyReaction' + notifyReactionEnabledFilename = accountDir + '/.notifyReactions' if not os.path.isfile(notifyReactionEnabledFilename): return @@ -2479,8 +2479,8 @@ def _reactionNotify(baseDir: str, domain: str, onionDomain: str, reactionHandle = actor if reactionHandle != handle: reactionStr = \ - reactionHandle + ' ' + url + '?reactionBy=' + actor + \ - ';emoji=' + emojiContent + reactionHandle + ' ' + url + '?reactBy=' + actor + \ + ';emoj=' + emojiContent prevReactionFile = accountDir + '/.prevReaction' # was there a previous reaction notification? if os.path.isfile(prevReactionFile): diff --git a/person.py b/person.py index 3594dd849..ada52381e 100644 --- a/person.py +++ b/person.py @@ -635,6 +635,13 @@ def createPerson(baseDir: str, nickname: str, domain: str, port: int, with open(notifyLikesFilename, 'w+') as nFile: nFile.write('\n') + # notify when posts have emoji reactions + if nickname != 'news': + notifyReactionsFilename = \ + acctDir(baseDir, nickname, domain) + '/.notifyReactions' + with open(notifyReactionsFilename, 'w+') as nFile: + nFile.write('\n') + theme = getConfigParam(baseDir, 'theme') if not theme: theme = 'default' diff --git a/translations/ar.json b/translations/ar.json index 33121d5c1..ce4f2ee73 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "برامج زحف الويب المعروفة", "Add to the calendar": "أضف إلى التقويم", "Content License": "ترخيص المحتوى", - "Reaction by": "رد فعل" + "Reaction by": "رد فعل", + "Notify on emoji reactions": "يخطر على ردود الفعل الرموز التعبيرية" } diff --git a/translations/ca.json b/translations/ca.json index a9771ffd7..4137bd30c 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Exploradors web coneguts", "Add to the calendar": "Afegeix al calendari", "Content License": "Llicència de contingut", - "Reaction by": "Reacció de" + "Reaction by": "Reacció de", + "Notify on emoji reactions": "Notificar sobre les reaccions dels emojis" } diff --git a/translations/cy.json b/translations/cy.json index 0415d6e30..cdbac2d5f 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Crawlers Gwe Hysbys", "Add to the calendar": "Ychwanegwch at y calendr", "Content License": "Trwydded Cynnwys", - "Reaction by": "Ymateb gan" + "Reaction by": "Ymateb gan", + "Notify on emoji reactions": "Hysbysu ar ymatebion emoji" } diff --git a/translations/de.json b/translations/de.json index 1663e535d..04816a5fb 100644 --- a/translations/de.json +++ b/translations/de.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Bekannte Web-Crawler", "Add to the calendar": "Zum Kalender hinzufügen", "Content License": "Inhaltslizenz", - "Reaction by": "Reaktion von" + "Reaction by": "Reaktion von", + "Notify on emoji reactions": "Bei Emoji-Reaktionen benachrichtigen" } diff --git a/translations/en.json b/translations/en.json index 627ea5a17..7e0000453 100644 --- a/translations/en.json +++ b/translations/en.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Known Web Crawlers", "Add to the calendar": "Add to the calendar", "Content License": "Content License", - "Reaction by": "Reaction by" + "Reaction by": "Reaction by", + "Notify on emoji reactions": "Notify on emoji reactions" } diff --git a/translations/es.json b/translations/es.json index 5dc843317..614f8a2d0 100644 --- a/translations/es.json +++ b/translations/es.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Rastreadores web conocidos", "Add to the calendar": "Agregar al calendario", "Content License": "Licencia de contenido", - "Reaction by": "Reacción de" + "Reaction by": "Reacción de", + "Notify on emoji reactions": "Notificar sobre reacciones emoji" } diff --git a/translations/fr.json b/translations/fr.json index b8ec4730a..c61206e78 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Crawlers Web connus", "Add to the calendar": "Ajouter au calendrier", "Content License": "Licence de contenu", - "Reaction by": "Réaction par" + "Reaction by": "Réaction par", + "Notify on emoji reactions": "Avertir sur les réactions emoji" } diff --git a/translations/ga.json b/translations/ga.json index f79bf3a30..89aceba59 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Crawlers Gréasáin Aitheanta", "Add to the calendar": "Cuir leis an bhféilire", "Content License": "Ceadúnas Ábhar", - "Reaction by": "Imoibriú le" + "Reaction by": "Imoibriú le", + "Notify on emoji reactions": "Fógra a thabhairt faoi imoibrithe emoji" } diff --git a/translations/hi.json b/translations/hi.json index 965c8281c..eac0c2e41 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "ज्ञात वेब क्रॉलर", "Add to the calendar": "कैलेंडर में जोड़ें", "Content License": "सामग्री लाइसेंस", - "Reaction by": "द्वारा प्रतिक्रिया" + "Reaction by": "द्वारा प्रतिक्रिया", + "Notify on emoji reactions": "इमोजी प्रतिक्रियाओं पर सूचित करें" } diff --git a/translations/it.json b/translations/it.json index 427a9c055..c54113472 100644 --- a/translations/it.json +++ b/translations/it.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Crawler Web conosciuti", "Add to the calendar": "Aggiungi al calendario", "Content License": "Licenza sui contenuti", - "Reaction by": "Reazione di" + "Reaction by": "Reazione di", + "Notify on emoji reactions": "Notifica sulle reazioni emoji" } diff --git a/translations/ja.json b/translations/ja.json index f204374f7..867f4dad0 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "既知のWebクローラー", "Add to the calendar": "カレンダーに追加", "Content License": "コンテンツライセンス", - "Reaction by": "による反応" + "Reaction by": "による反応", + "Notify on emoji reactions": "絵文字の反応を通知する" } diff --git a/translations/ku.json b/translations/ku.json index 880e0bc96..e76ca988f 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Crawlerên Webê yên naskirî", "Add to the calendar": "Di salnameyê de zêde bike", "Content License": "Naverok License de", - "Reaction by": "Reaction by" + "Reaction by": "Reaction by", + "Notify on emoji reactions": "Li ser reaksiyonên emoji agahdar bikin" } diff --git a/translations/oc.json b/translations/oc.json index 9e2c9cce8..072298e3d 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -489,5 +489,6 @@ "Known Web Crawlers": "Known Web Crawlers", "Add to the calendar": "Add to the calendar", "Content License": "Content License", - "Reaction by": "Reaction by" + "Reaction by": "Reaction by", + "Notify on emoji reactions": "Notify on emoji reactions" } diff --git a/translations/pt.json b/translations/pt.json index 054183025..710b9216a 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Rastreadores da Web conhecidos", "Add to the calendar": "Adicionar ao calendário", "Content License": "Licença de Conteúdo", - "Reaction by": "Reazione di" + "Reaction by": "Reazione di", + "Notify on emoji reactions": "Notificar sobre reações de emoji" } diff --git a/translations/ru.json b/translations/ru.json index ca46b77e9..adecffaab 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Известные веб-сканеры", "Add to the calendar": "Добавить в календарь", "Content License": "Лицензия на содержание", - "Reaction by": "Реакция со стороны" + "Reaction by": "Реакция со стороны", + "Notify on emoji reactions": "Уведомлять о реакции на смайлики" } diff --git a/translations/sw.json b/translations/sw.json index dfaf4d7a3..d7a969e06 100644 --- a/translations/sw.json +++ b/translations/sw.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "Watambaji Wavuti Wanaojulikana", "Add to the calendar": "Ongeza kwenye kalenda", "Content License": "Leseni ya Maudhui", - "Reaction by": "Majibu kwa" + "Reaction by": "Majibu kwa", + "Notify on emoji reactions": "Arifu kuhusu maitikio ya emoji" } diff --git a/translations/zh.json b/translations/zh.json index fe5b970a1..d2d07e431 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -493,5 +493,6 @@ "Known Web Crawlers": "已知的网络爬虫", "Add to the calendar": "添加到日历", "Content License": "内容许可", - "Reaction by": "反应由" + "Reaction by": "反应由", + "Notify on emoji reactions": "通知表情符号反应" } diff --git a/webapp_profile.py b/webapp_profile.py index 269851597..1b68e8b47 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1867,7 +1867,8 @@ def _htmlEditProfileOptions(isAdmin: bool, manuallyApprovesFollowers: str, isBot: str, isGroup: str, followDMs: str, removeTwitter: str, - notifyLikes: str, hideLikeButton: str, + notifyLikes: str, notifyReactions: str, + hideLikeButton: str, translate: {}) -> str: """option checkboxes section of edit profile screen """ @@ -1891,6 +1892,9 @@ def _htmlEditProfileOptions(isAdmin: bool, editProfileForm += \ editCheckBox(translate['Notify when posts are liked'], 'notifyLikes', notifyLikes) + editProfileForm += \ + editCheckBox(translate['Notify on emoji reactions'], + 'notifyReactions', notifyReactions) editProfileForm += \ editCheckBox(translate["Don't show the Like button"], 'hideLikeButton', hideLikeButton) @@ -2048,7 +2052,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, displayNickname = nickname isBot = isGroup = followDMs = removeTwitter = '' - notifyLikes = hideLikeButton = mediaInstanceStr = '' + notifyLikes = notifyReactions = hideLikeButton = mediaInstanceStr = '' blogsInstanceStr = newsInstanceStr = movedTo = twitterStr = '' bioStr = donateUrl = websiteUrl = emailAddress = PGPpubKey = '' PGPfingerprint = xmppAddress = matrixAddress = '' @@ -2099,6 +2103,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, removeTwitter = 'checked' if os.path.isfile(accountDir + '/.notifyLikes'): notifyLikes = 'checked' + if os.path.isfile(accountDir + '/.notifyReactions'): + notifyReactions = 'checked' if os.path.isfile(accountDir + '/.hideLikeButton'): hideLikeButton = 'checked' @@ -2196,7 +2202,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, editProfileForm += \ _htmlEditProfileOptions(isAdmin, manuallyApprovesFollowers, isBot, isGroup, followDMs, removeTwitter, - notifyLikes, hideLikeButton, translate) + notifyLikes, notifyReactions, + hideLikeButton, translate) # Contact information editProfileForm += \