mirror of https://gitlab.com/bashrc2/epicyon
Option to turn emoji reactions off
parent
6b76ab4754
commit
edd62c1f1b
35
daemon.py
35
daemon.py
|
@ -5725,6 +5725,38 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
hideLikeButtonFile)
|
hideLikeButtonFile)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# hide Reaction button
|
||||||
|
hideReactionButtonFile = \
|
||||||
|
acctDir(baseDir, nickname, domain) + \
|
||||||
|
'/.hideReactionButton'
|
||||||
|
notifyReactionsFilename = \
|
||||||
|
acctDir(baseDir, nickname, domain) + \
|
||||||
|
'/.notifyReactions'
|
||||||
|
hideReactionButtonActive = False
|
||||||
|
if fields.get('hideReactionButton'):
|
||||||
|
if fields['hideReactionButton'] == 'on':
|
||||||
|
hideReactionButtonActive = True
|
||||||
|
with open(hideReactionButtonFile, 'w+') as rFile:
|
||||||
|
rFile.write('\n')
|
||||||
|
# remove notify Reaction selection
|
||||||
|
if os.path.isfile(notifyReactionsFilename):
|
||||||
|
try:
|
||||||
|
os.remove(notifyReactionsFilename)
|
||||||
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
notifyReactionsFilename)
|
||||||
|
pass
|
||||||
|
if not hideReactionButtonActive:
|
||||||
|
if os.path.isfile(hideReactionButtonFile):
|
||||||
|
try:
|
||||||
|
os.remove(hideReactionButtonFile)
|
||||||
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
hideReactionButtonFile)
|
||||||
|
pass
|
||||||
|
|
||||||
# notify about new Likes
|
# notify about new Likes
|
||||||
if onFinalWelcomeScreen:
|
if onFinalWelcomeScreen:
|
||||||
# default setting from welcome screen
|
# default setting from welcome screen
|
||||||
|
@ -5760,7 +5792,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
else:
|
else:
|
||||||
notifyReactionsActive = False
|
notifyReactionsActive = False
|
||||||
if fields.get('notifyReactions'):
|
if fields.get('notifyReactions'):
|
||||||
if fields['notifyReactions'] == 'on':
|
if fields['notifyReactions'] == 'on' and \
|
||||||
|
not hideReactionButtonActive:
|
||||||
notifyReactionsActive = True
|
notifyReactionsActive = True
|
||||||
with open(notifyReactionsFilename,
|
with open(notifyReactionsFilename,
|
||||||
'w+') as rFile:
|
'w+') as rFile:
|
||||||
|
|
6
inbox.py
6
inbox.py
|
@ -1263,9 +1263,15 @@ def _receiveReaction(recentPostsCache: {},
|
||||||
return False
|
return False
|
||||||
if not os.path.isdir(baseDir + '/accounts/' + handle):
|
if not os.path.isdir(baseDir + '/accounts/' + handle):
|
||||||
print('DEBUG: unknown recipient of emoji reaction - ' + handle)
|
print('DEBUG: unknown recipient of emoji reaction - ' + handle)
|
||||||
|
if os.path.isfile(baseDir + '/accounts/' + handle +
|
||||||
|
'/.hideReactionButton'):
|
||||||
|
print('Emoji reaction rejected by ' + handle +
|
||||||
|
' due to their settings')
|
||||||
|
return True
|
||||||
# if this post in the outbox of the person?
|
# if this post in the outbox of the person?
|
||||||
handleName = handle.split('@')[0]
|
handleName = handle.split('@')[0]
|
||||||
handleDom = handle.split('@')[1]
|
handleDom = handle.split('@')[1]
|
||||||
|
|
||||||
postReactionId = messageJson['object']
|
postReactionId = messageJson['object']
|
||||||
emojiContent = removeHtml(messageJson['content'])
|
emojiContent = removeHtml(messageJson['content'])
|
||||||
if not emojiContent:
|
if not emojiContent:
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "ترخيص المحتوى",
|
"Content License": "ترخيص المحتوى",
|
||||||
"Reaction by": "رد فعل",
|
"Reaction by": "رد فعل",
|
||||||
"Notify on emoji reactions": "يخطر على ردود الفعل الرموز التعبيرية",
|
"Notify on emoji reactions": "يخطر على ردود الفعل الرموز التعبيرية",
|
||||||
"Select reaction": "حدد رد الفعل"
|
"Select reaction": "حدد رد الفعل",
|
||||||
|
"Don't show the Reaction button": "لا تظهر زر رد الفعل"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Llicència de contingut",
|
"Content License": "Llicència de contingut",
|
||||||
"Reaction by": "Reacció de",
|
"Reaction by": "Reacció de",
|
||||||
"Notify on emoji reactions": "Notificar sobre les reaccions dels emojis",
|
"Notify on emoji reactions": "Notificar sobre les reaccions dels emojis",
|
||||||
"Select reaction": "Seleccioneu la reacció"
|
"Select reaction": "Seleccioneu la reacció",
|
||||||
|
"Don't show the Reaction button": "No mostris el botó de reacció"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Trwydded Cynnwys",
|
"Content License": "Trwydded Cynnwys",
|
||||||
"Reaction by": "Ymateb gan",
|
"Reaction by": "Ymateb gan",
|
||||||
"Notify on emoji reactions": "Hysbysu ar ymatebion emoji",
|
"Notify on emoji reactions": "Hysbysu ar ymatebion emoji",
|
||||||
"Select reaction": "Dewiswch adwaith"
|
"Select reaction": "Dewiswch adwaith",
|
||||||
|
"Don't show the Reaction button": "Peidiwch â dangos y botwm Adwaith"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Inhaltslizenz",
|
"Content License": "Inhaltslizenz",
|
||||||
"Reaction by": "Reaktion von",
|
"Reaction by": "Reaktion von",
|
||||||
"Notify on emoji reactions": "Bei Emoji-Reaktionen benachrichtigen",
|
"Notify on emoji reactions": "Bei Emoji-Reaktionen benachrichtigen",
|
||||||
"Select reaction": "Reaktion auswählen"
|
"Select reaction": "Reaktion auswählen",
|
||||||
|
"Don't show the Reaction button": "Reaktionstaste nicht anzeigen"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Content License",
|
"Content License": "Content License",
|
||||||
"Reaction by": "Reaction by",
|
"Reaction by": "Reaction by",
|
||||||
"Notify on emoji reactions": "Notify on emoji reactions",
|
"Notify on emoji reactions": "Notify on emoji reactions",
|
||||||
"Select reaction": "Select reaction"
|
"Select reaction": "Select reaction",
|
||||||
|
"Don't show the Reaction button": "Don't show the Reaction button"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Licencia de contenido",
|
"Content License": "Licencia de contenido",
|
||||||
"Reaction by": "Reacción de",
|
"Reaction by": "Reacción de",
|
||||||
"Notify on emoji reactions": "Notificar sobre reacciones emoji",
|
"Notify on emoji reactions": "Notificar sobre reacciones emoji",
|
||||||
"Select reaction": "Seleccionar reacción"
|
"Select reaction": "Seleccionar reacción",
|
||||||
|
"Don't show the Reaction button": "No mostrar el botón de reacción"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Licence de contenu",
|
"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",
|
"Notify on emoji reactions": "Avertir sur les réactions emoji",
|
||||||
"Select reaction": "Sélectionnez la réaction"
|
"Select reaction": "Sélectionnez la réaction",
|
||||||
|
"Don't show the Reaction button": "Ne pas afficher le bouton Réaction"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Ceadúnas Ábhar",
|
"Content License": "Ceadúnas Ábhar",
|
||||||
"Reaction by": "Imoibriú le",
|
"Reaction by": "Imoibriú le",
|
||||||
"Notify on emoji reactions": "Fógra a thabhairt faoi imoibrithe emoji",
|
"Notify on emoji reactions": "Fógra a thabhairt faoi imoibrithe emoji",
|
||||||
"Select reaction": "Roghnaigh imoibriú"
|
"Select reaction": "Roghnaigh imoibriú",
|
||||||
|
"Don't show the Reaction button": "Ná taispeáin an cnaipe Imoibriú"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "सामग्री लाइसेंस",
|
"Content License": "सामग्री लाइसेंस",
|
||||||
"Reaction by": "द्वारा प्रतिक्रिया",
|
"Reaction by": "द्वारा प्रतिक्रिया",
|
||||||
"Notify on emoji reactions": "इमोजी प्रतिक्रियाओं पर सूचित करें",
|
"Notify on emoji reactions": "इमोजी प्रतिक्रियाओं पर सूचित करें",
|
||||||
"Select reaction": "प्रतिक्रिया का चयन करें"
|
"Select reaction": "प्रतिक्रिया का चयन करें",
|
||||||
|
"Don't show the Reaction button": "प्रतिक्रिया बटन न दिखाएं"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Licenza sui contenuti",
|
"Content License": "Licenza sui contenuti",
|
||||||
"Reaction by": "Reazione di",
|
"Reaction by": "Reazione di",
|
||||||
"Notify on emoji reactions": "Notifica sulle reazioni emoji",
|
"Notify on emoji reactions": "Notifica sulle reazioni emoji",
|
||||||
"Select reaction": "Seleziona reazione"
|
"Select reaction": "Seleziona reazione",
|
||||||
|
"Don't show the Reaction button": "Non mostrare il pulsante Reazione"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "コンテンツライセンス",
|
"Content License": "コンテンツライセンス",
|
||||||
"Reaction by": "による反応",
|
"Reaction by": "による反応",
|
||||||
"Notify on emoji reactions": "絵文字の反応を通知する",
|
"Notify on emoji reactions": "絵文字の反応を通知する",
|
||||||
"Select reaction": "反応を選択"
|
"Select reaction": "反応を選択",
|
||||||
|
"Don't show the Reaction button": "反応ボタンを表示しない"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Naverok License de",
|
"Content License": "Naverok License de",
|
||||||
"Reaction by": "Reaction by",
|
"Reaction by": "Reaction by",
|
||||||
"Notify on emoji reactions": "Li ser reaksiyonên emoji agahdar bikin",
|
"Notify on emoji reactions": "Li ser reaksiyonên emoji agahdar bikin",
|
||||||
"Select reaction": "Reaksiyonê hilbijêrin"
|
"Select reaction": "Reaksiyonê hilbijêrin",
|
||||||
|
"Don't show the Reaction button": "Bişkoka Reaksiyonê nîşan nede"
|
||||||
}
|
}
|
||||||
|
|
|
@ -491,5 +491,6 @@
|
||||||
"Content License": "Content License",
|
"Content License": "Content License",
|
||||||
"Reaction by": "Reaction by",
|
"Reaction by": "Reaction by",
|
||||||
"Notify on emoji reactions": "Notify on emoji reactions",
|
"Notify on emoji reactions": "Notify on emoji reactions",
|
||||||
"Select reaction": "Select reaction"
|
"Select reaction": "Select reaction",
|
||||||
|
"Don't show the Reaction button": "Don't show the Reaction button"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Licença de Conteúdo",
|
"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",
|
"Notify on emoji reactions": "Notificar sobre reações de emoji",
|
||||||
"Select reaction": "Selecione a reação"
|
"Select reaction": "Selecione a reação",
|
||||||
|
"Don't show the Reaction button": "Não mostrar o botão de reação"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Лицензия на содержание",
|
"Content License": "Лицензия на содержание",
|
||||||
"Reaction by": "Реакция со стороны",
|
"Reaction by": "Реакция со стороны",
|
||||||
"Notify on emoji reactions": "Уведомлять о реакции на смайлики",
|
"Notify on emoji reactions": "Уведомлять о реакции на смайлики",
|
||||||
"Select reaction": "Выберите реакцию"
|
"Select reaction": "Выберите реакцию",
|
||||||
|
"Don't show the Reaction button": "Не показывать кнопку реакции"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "Leseni ya Maudhui",
|
"Content License": "Leseni ya Maudhui",
|
||||||
"Reaction by": "Majibu kwa",
|
"Reaction by": "Majibu kwa",
|
||||||
"Notify on emoji reactions": "Arifu kuhusu maitikio ya emoji",
|
"Notify on emoji reactions": "Arifu kuhusu maitikio ya emoji",
|
||||||
"Select reaction": "Chagua majibu"
|
"Select reaction": "Chagua majibu",
|
||||||
|
"Don't show the Reaction button": "Usionyeshe kitufe cha Majibu"
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,5 +495,6 @@
|
||||||
"Content License": "内容许可",
|
"Content License": "内容许可",
|
||||||
"Reaction by": "反应由",
|
"Reaction by": "反应由",
|
||||||
"Notify on emoji reactions": "通知表情符号反应",
|
"Notify on emoji reactions": "通知表情符号反应",
|
||||||
"Select reaction": "选择反应"
|
"Select reaction": "选择反应",
|
||||||
|
"Don't show the Reaction button": "不显示“反应”按钮"
|
||||||
}
|
}
|
||||||
|
|
|
@ -704,6 +704,7 @@ def _getBookmarkIconHtml(nickname: str, domainFull: str,
|
||||||
def _getReactionIconHtml(nickname: str, domainFull: str,
|
def _getReactionIconHtml(nickname: str, domainFull: str,
|
||||||
postJsonObject: {},
|
postJsonObject: {},
|
||||||
isModerationPost: bool,
|
isModerationPost: bool,
|
||||||
|
showReactionButton: bool,
|
||||||
translate: {},
|
translate: {},
|
||||||
enableTimingLog: bool,
|
enableTimingLog: bool,
|
||||||
postStartTime, boxName: str,
|
postStartTime, boxName: str,
|
||||||
|
@ -713,7 +714,7 @@ def _getReactionIconHtml(nickname: str, domainFull: str,
|
||||||
"""
|
"""
|
||||||
reactionStr = ''
|
reactionStr = ''
|
||||||
|
|
||||||
if isModerationPost:
|
if not showReactionButton or isModerationPost:
|
||||||
return reactionStr
|
return reactionStr
|
||||||
|
|
||||||
reactionIcon = 'reaction.png'
|
reactionIcon = 'reaction.png'
|
||||||
|
@ -1660,6 +1661,13 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
|
||||||
if os.path.isfile(hideLikeButtonFile):
|
if os.path.isfile(hideLikeButtonFile):
|
||||||
showLikeButton = False
|
showLikeButton = False
|
||||||
|
|
||||||
|
# whether to show a reaction button
|
||||||
|
hideReactionButtonFile = \
|
||||||
|
acctDir(baseDir, nickname, domain) + '/.hideReactionButton'
|
||||||
|
showReactionButton = True
|
||||||
|
if os.path.isfile(hideReactionButtonFile):
|
||||||
|
showReactionButton = False
|
||||||
|
|
||||||
likeJsonObject = postJsonObject
|
likeJsonObject = postJsonObject
|
||||||
if announceJsonObject:
|
if announceJsonObject:
|
||||||
likeJsonObject = announceJsonObject
|
likeJsonObject = announceJsonObject
|
||||||
|
@ -1691,6 +1699,7 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
|
||||||
_getReactionIconHtml(nickname, domainFull,
|
_getReactionIconHtml(nickname, domainFull,
|
||||||
postJsonObject,
|
postJsonObject,
|
||||||
isModerationPost,
|
isModerationPost,
|
||||||
|
showReactionButton,
|
||||||
translate,
|
translate,
|
||||||
enableTimingLog,
|
enableTimingLog,
|
||||||
postStartTime, boxName,
|
postStartTime, boxName,
|
||||||
|
|
|
@ -1869,6 +1869,7 @@ def _htmlEditProfileOptions(isAdmin: bool,
|
||||||
followDMs: str, removeTwitter: str,
|
followDMs: str, removeTwitter: str,
|
||||||
notifyLikes: str, notifyReactions: str,
|
notifyLikes: str, notifyReactions: str,
|
||||||
hideLikeButton: str,
|
hideLikeButton: str,
|
||||||
|
hideReactionButton: str,
|
||||||
translate: {}) -> str:
|
translate: {}) -> str:
|
||||||
"""option checkboxes section of edit profile screen
|
"""option checkboxes section of edit profile screen
|
||||||
"""
|
"""
|
||||||
|
@ -1898,6 +1899,9 @@ def _htmlEditProfileOptions(isAdmin: bool,
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
editCheckBox(translate["Don't show the Like button"],
|
editCheckBox(translate["Don't show the Like button"],
|
||||||
'hideLikeButton', hideLikeButton)
|
'hideLikeButton', hideLikeButton)
|
||||||
|
editProfileForm += \
|
||||||
|
editCheckBox(translate["Don't show the Reaction button"],
|
||||||
|
'hideReactionButton', hideReactionButton)
|
||||||
editProfileForm += ' </div>\n'
|
editProfileForm += ' </div>\n'
|
||||||
return editProfileForm
|
return editProfileForm
|
||||||
|
|
||||||
|
@ -2052,7 +2056,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
|
|
||||||
displayNickname = nickname
|
displayNickname = nickname
|
||||||
isBot = isGroup = followDMs = removeTwitter = ''
|
isBot = isGroup = followDMs = removeTwitter = ''
|
||||||
notifyLikes = notifyReactions = hideLikeButton = mediaInstanceStr = ''
|
notifyLikes = notifyReactions = ''
|
||||||
|
hideLikeButton = hideReactionButton = mediaInstanceStr = ''
|
||||||
blogsInstanceStr = newsInstanceStr = movedTo = twitterStr = ''
|
blogsInstanceStr = newsInstanceStr = movedTo = twitterStr = ''
|
||||||
bioStr = donateUrl = websiteUrl = emailAddress = PGPpubKey = ''
|
bioStr = donateUrl = websiteUrl = emailAddress = PGPpubKey = ''
|
||||||
PGPfingerprint = xmppAddress = matrixAddress = ''
|
PGPfingerprint = xmppAddress = matrixAddress = ''
|
||||||
|
@ -2107,6 +2112,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
notifyReactions = 'checked'
|
notifyReactions = 'checked'
|
||||||
if os.path.isfile(accountDir + '/.hideLikeButton'):
|
if os.path.isfile(accountDir + '/.hideLikeButton'):
|
||||||
hideLikeButton = 'checked'
|
hideLikeButton = 'checked'
|
||||||
|
if os.path.isfile(accountDir + '/.hideReactionButton'):
|
||||||
|
hideReactionButton = 'checked'
|
||||||
|
|
||||||
mediaInstance = getConfigParam(baseDir, "mediaInstance")
|
mediaInstance = getConfigParam(baseDir, "mediaInstance")
|
||||||
if mediaInstance:
|
if mediaInstance:
|
||||||
|
@ -2203,7 +2210,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
_htmlEditProfileOptions(isAdmin, manuallyApprovesFollowers,
|
_htmlEditProfileOptions(isAdmin, manuallyApprovesFollowers,
|
||||||
isBot, isGroup, followDMs, removeTwitter,
|
isBot, isGroup, followDMs, removeTwitter,
|
||||||
notifyLikes, notifyReactions,
|
notifyLikes, notifyReactions,
|
||||||
hideLikeButton, translate)
|
hideLikeButton, hideReactionButton,
|
||||||
|
translate)
|
||||||
|
|
||||||
# Contact information
|
# Contact information
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
|
|
Loading…
Reference in New Issue