From 2923e74db114eadc30705c9b5b4389d0089cf4e3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 19 Aug 2019 11:46:23 +0100 Subject: [PATCH] Tidying --- content.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/content.py b/content.py index 66f387cc0..db6f2350e 100644 --- a/content.py +++ b/content.py @@ -122,12 +122,13 @@ def addMention(wordStr: str,httpPrefix: str,following: str,replaceMentions: {},r possibleNickname=possibleHandle.split('@')[0] possibleDomain=possibleHandle.split('@')[1].strip('\n') for follow in following: - if follow.replace('\n','')==possibleHandle: - recipientActor=httpPrefix+"://"+possibleDomain+"/users/"+possibleNickname - if recipientActor not in recipients: - recipients.append(recipientActor) - replaceMentions[wordStr]="@"+possibleNickname+"" - return True + if follow.replace('\n','')!=possibleHandle: + continue + recipientActor=httpPrefix+"://"+possibleDomain+"/users/"+possibleNickname + if recipientActor not in recipients: + recipients.append(recipientActor) + replaceMentions[wordStr]="@"+possibleNickname+"" + return True # @nick@domain if '@' in possibleHandle: if not (possibleDomain=='localhost' or '.' in possibleDomain): @@ -135,8 +136,8 @@ def addMention(wordStr: str,httpPrefix: str,following: str,replaceMentions: {},r recipientActor=httpPrefix+"://"+possibleDomain+"/users/"+possibleNickname if recipientActor not in recipients: recipients.append(recipientActor) - replaceMentions[wordStr]="@"+possibleNickname+"" - return True + replaceMentions[wordStr]="@"+possibleNickname+"" + return True return False def addHtmlTags(baseDir: str,httpPrefix: str, \