Remove long words earlier

main
Bob Mottram 2020-05-17 10:44:42 +01:00
parent 4608678cae
commit a9f3f048ae
1 changed files with 3 additions and 3 deletions

View File

@ -3068,6 +3068,9 @@ def downloadAnnounce(session, baseDir: str, httpPrefix: str,
if isFiltered(baseDir, nickname, domain, announcedJson['content']): if isFiltered(baseDir, nickname, domain, announcedJson['content']):
rejectAnnounce(announceFilename) rejectAnnounce(announceFilename)
return None return None
# remove any long words
announcedJson['content'] = \
removeLongWords(announcedJson['content'], 40, [])
# wrap in create to be consistent with other posts # wrap in create to be consistent with other posts
announcedJson = \ announcedJson = \
@ -3082,9 +3085,6 @@ def downloadAnnounce(session, baseDir: str, httpPrefix: str,
# set the id to the original status # set the id to the original status
announcedJson['id'] = postJsonObject['object'] announcedJson['id'] = postJsonObject['object']
announcedJson['object']['id'] = postJsonObject['object'] announcedJson['object']['id'] = postJsonObject['object']
# remove any long words
announcedJson['content'] = \
removeLongWords(announcedJson['content'], 40, [])
# check that the repeat isn't for a blocked account # check that the repeat isn't for a blocked account
attributedNickname = \ attributedNickname = \
getNicknameFromActor(announcedJson['object']['id']) getNicknameFromActor(announcedJson['object']['id'])