mirror of https://gitlab.com/bashrc2/epicyon
Sending out updates when votes on a question change
parent
d0705c3f98
commit
c94b80a36d
17
inbox.py
17
inbox.py
|
@ -54,6 +54,7 @@ from posts import isDM
|
||||||
from posts import isReply
|
from posts import isReply
|
||||||
from posts import isImageMedia
|
from posts import isImageMedia
|
||||||
from posts import sendSignedJson
|
from posts import sendSignedJson
|
||||||
|
from posts import sendToFollowersThread
|
||||||
from webinterface import individualPostAsHtml
|
from webinterface import individualPostAsHtml
|
||||||
from webinterface import getIconsDir
|
from webinterface import getIconsDir
|
||||||
from question import questionUpdateVotes
|
from question import questionUpdateVotes
|
||||||
|
@ -1798,7 +1799,21 @@ def inboxAfterCapabilities(recentPostsCache: {},maxRecentPosts: int, \
|
||||||
populateReplies(baseDir,httpPrefix,domain,postJsonObject,maxReplies,debug)
|
populateReplies(baseDir,httpPrefix,domain,postJsonObject,maxReplies,debug)
|
||||||
|
|
||||||
nickname=handle.split('@')[0]
|
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:
|
if not isGroup:
|
||||||
# create a DM notification file if needed
|
# create a DM notification file if needed
|
||||||
|
|
2
posts.py
2
posts.py
|
@ -1805,7 +1805,7 @@ def sendToFollowers(session,baseDir: str, \
|
||||||
print('DEBUG: End of sendToFollowers')
|
print('DEBUG: End of sendToFollowers')
|
||||||
|
|
||||||
def sendToFollowersThread(session,baseDir: str, \
|
def sendToFollowersThread(session,baseDir: str, \
|
||||||
nickname: str, domain: str, port: int, \
|
nickname: str,domain: str,port: int, \
|
||||||
httpPrefix: str,federationList: [], \
|
httpPrefix: str,federationList: [], \
|
||||||
sendThreads: [],postLog: [], \
|
sendThreads: [],postLog: [], \
|
||||||
cachedWebfingers: {},personCache: {}, \
|
cachedWebfingers: {},personCache: {}, \
|
||||||
|
|
Loading…
Reference in New Issue