diff --git a/inbox.py b/inbox.py index 8f838d5b7..2db7ed43b 100644 --- a/inbox.py +++ b/inbox.py @@ -54,6 +54,7 @@ from posts import isDM from posts import isReply from posts import isImageMedia from posts import sendSignedJson +from posts import sendToFollowersThread from webinterface import individualPostAsHtml from webinterface import getIconsDir from question import questionUpdateVotes @@ -1798,7 +1799,21 @@ def inboxAfterCapabilities(recentPostsCache: {},maxRecentPosts: int, \ populateReplies(baseDir,httpPrefix,domain,postJsonObject,maxReplies,debug) nickname=handle.split('@')[0] - questionUpdateVotes(baseDir,nickname,domain,postJsonObject) + + # if this is a reply to a question then update the votes + questionJson=questionUpdateVotes(baseDir,nickname,domain,postJsonObject) + if questionJson: + # Is this a question created by this instance? + if questionJson['object']['id'].startswith(httpPrefix+'://'+domain): + # if the votes on a question have changed then send out an update + questionJson['type']='Update' + sendToFollowersThread(session,baseDir, \ + nickname,domain,port, \ + httpPrefix,federationList, \ + sendThreads,postLog, \ + cachedWebfingers,personCache, \ + postJsonObject,debug, \ + __version__) if not isGroup: # create a DM notification file if needed diff --git a/posts.py b/posts.py index 585da6d4b..921f2819d 100644 --- a/posts.py +++ b/posts.py @@ -1805,7 +1805,7 @@ def sendToFollowers(session,baseDir: str, \ print('DEBUG: End of sendToFollowers') def sendToFollowersThread(session,baseDir: str, \ - nickname: str, domain: str, port: int, \ + nickname: str,domain: str,port: int, \ httpPrefix: str,federationList: [], \ sendThreads: [],postLog: [], \ cachedWebfingers: {},personCache: {}, \