diff --git a/webapp_person_options.py b/webapp_person_options.py index d6c7c506f..89e142d03 100644 --- a/webapp_person_options.py +++ b/webapp_person_options.py @@ -18,6 +18,7 @@ from follow import isFollowingActor from followingCalendar import receivingCalendarEvents from webapp_utils import htmlHeaderWithExternalStyle from webapp_utils import htmlFooter +from webapp_utils import getBrokenLinkSubstitute def htmlPersonOptions(defaultTimeline: str, @@ -103,7 +104,7 @@ def htmlPersonOptions(defaultTimeline: str, optionsStr += '
\n' optionsStr += ' \n' optionsStr += ' \n' + '" ' + getBrokenLinkSubstitute() + '/>\n' handle = getNicknameFromActor(optionsActor) + '@' + optionsDomain optionsStr += \ '

' + translate['Options for'] + \ diff --git a/webapp_post.py b/webapp_post.py index d4da8f7a8..3b2bf77d2 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -55,6 +55,7 @@ from webapp_utils import getContentWarningButton from webapp_utils import getPostAttachmentsAsHtml from webapp_utils import htmlHeaderWithExternalStyle from webapp_utils import htmlFooter +from webapp_utils import getBrokenLinkSubstitute from webapp_media import addEmbeddedElements from webapp_question import insertQuestion from devices import E2EEdecryptMessageFromDevice @@ -201,14 +202,6 @@ def getAvatarImageUrl(session, return avatarUrl -def getBrokenLinkSubstitute() -> str: - """Returns html used to show a default image if the link to - an image is broken - """ - return " onerror=\"this.onerror=null; this.src='" + \ - "/icons/avatar_default.png'\"" - - def getAvatarImageHtml(showAvatarOptions: bool, nickname: str, domainFull: str, avatarUrl: str, postActor: str, diff --git a/webapp_utils.py b/webapp_utils.py index b8caff443..9f2c6bf41 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -20,6 +20,14 @@ from content import addHtmlTags from content import replaceEmojiFromTags +def getBrokenLinkSubstitute() -> str: + """Returns html used to show a default image if the link to + an image is broken + """ + return " onerror=\"this.onerror=null; this.src='" + \ + "/icons/avatar_default.png'\"" + + def htmlFollowingList(cssCache: {}, baseDir: str, followingFilename: str) -> str: """Returns a list of handles being followed