Trace parameter

merge-requests/8/head
Bob Mottram 2020-12-18 17:49:17 +00:00
parent 2736b7252b
commit af919974d7
13 changed files with 44 additions and 30 deletions

View File

@ -369,7 +369,7 @@ def sendAnnounceViaServer(baseDir: str, session,
personCache,
projectVersion, httpPrefix,
fromNickname, fromDomain,
postToBox)
postToBox, 73528)
if not inboxUrl:
if debug:

View File

@ -123,7 +123,7 @@ def sendAvailabilityViaServer(baseDir: str, session,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, nickname,
domain, postToBox)
domain, postToBox, 57262)
if not inboxUrl:
if debug:

View File

@ -441,7 +441,7 @@ def sendBookmarkViaServer(baseDir: str, session,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(baseDir, session, wfRequest, personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox, 72483)
if not inboxUrl:
if debug:
@ -518,7 +518,7 @@ def sendUndoBookmarkViaServer(baseDir: str, session,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(baseDir, session, wfRequest, personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox, 72528)
if not inboxUrl:
if debug:

View File

@ -136,7 +136,7 @@ def sendDeleteViaServer(baseDir: str, session,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(baseDir, session, wfRequest, personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox, 53036)
if not inboxUrl:
if debug:

View File

@ -995,7 +995,7 @@ def sendFollowRequestViaServer(baseDir: str, session,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(baseDir, session, wfRequest, personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox, 52025)
if not inboxUrl:
if debug:
@ -1086,7 +1086,8 @@ def sendUnfollowRequestViaServer(baseDir: str, session,
wfRequest, personCache,
projectVersion, httpPrefix,
fromNickname,
fromDomain, postToBox)
fromDomain, postToBox,
76536)
if not inboxUrl:
if debug:

View File

@ -257,7 +257,7 @@ def sendLikeViaServer(baseDir: str, session,
personCache,
projectVersion, httpPrefix,
fromNickname, fromDomain,
postToBox)
postToBox, 72873)
if not inboxUrl:
if debug:
@ -335,7 +335,8 @@ def sendUndoLikeViaServer(baseDir: str, session,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox,
72625)
if not inboxUrl:
if debug:

View File

@ -141,13 +141,13 @@ def cleanHtml(rawHtml: str) -> str:
return html.unescape(text)
def getUserUrl(wfRequest: {}) -> str:
def getUserUrl(wfRequest: {}, sourceId=0) -> str:
"""Gets the actor url from a webfinger request
"""
print('getUserUrl: ' + str(wfRequest))
print('getUserUrl: ' + str(sourceId) + ' ' + str(wfRequest))
if not wfRequest.get('links'):
print('getUserUrl webfinger activity+json contains no links ' +
str(wfRequest))
str(sourceId) + ' ' + str(wfRequest))
return None
for link in wfRequest['links']:
if not (link.get('type') and link.get('href')):
@ -160,7 +160,7 @@ def getUserUrl(wfRequest: {}) -> str:
'/channel/' in link['href']):
print('getUserUrl webfinger activity+json ' +
'contains single user instance actor ' +
str(link))
str(sourceId) + ' ' + str(link))
return link['href']
return None
@ -207,13 +207,14 @@ def getPersonBox(baseDir: str, session, wfRequest: {},
personCache: {},
projectVersion: str, httpPrefix: str,
nickname: str, domain: str,
boxName='inbox') -> (str, str, str, str, str, str, str, str):
boxName='inbox',
sourceId=0) -> (str, str, str, str, str, str, str, str):
profileStr = 'https://www.w3.org/ns/activitystreams'
asHeader = {
'Accept': 'application/activity+json; profile="' + profileStr + '"'
}
if not wfRequest.get('errors'):
personUrl = getUserUrl(wfRequest)
personUrl = getUserUrl(wfRequest, sourceId)
else:
if nickname == 'dev':
# try single user instance
@ -1774,7 +1775,8 @@ def sendPost(projectVersion: str,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
nickname, domain, postToBox)
nickname, domain, postToBox,
72533)
if not inboxUrl:
return 3
@ -1889,7 +1891,8 @@ def sendPostViaServer(projectVersion: str,
personCache,
projectVersion, httpPrefix,
fromNickname,
fromDomain, postToBox)
fromDomain, postToBox,
82796)
if not inboxUrl:
if debug:
print('DEBUG: No ' + postToBox + ' was found for ' + handle)
@ -2088,7 +2091,8 @@ def sendSignedJson(postJsonObject: {}, session, baseDir: str,
displayName) = getPersonBox(baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
nickname, domain, postToBox)
nickname, domain, postToBox,
30873)
print("inboxUrl: " + str(inboxUrl))
print("toPersonId: " + str(toPersonId))
@ -3396,7 +3400,8 @@ def getPublicPostsOfPerson(baseDir: str, nickname: str, domain: str,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
nickname, domain, 'outbox')
nickname, domain, 'outbox',
62524)
maxMentions = 10
maxEmoji = 10
maxAttachments = 5
@ -3437,7 +3442,8 @@ def getPublicPostDomains(session, baseDir: str, nickname: str, domain: str,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
nickname, domain, 'outbox')
nickname, domain, 'outbox',
92522)
maxMentions = 99
maxEmoji = 99
maxAttachments = 5
@ -3480,7 +3486,8 @@ def getPublicPostInfo(session, baseDir: str, nickname: str, domain: str,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
nickname, domain, 'outbox')
nickname, domain, 'outbox',
13863)
maxMentions = 99
maxEmoji = 99
maxAttachments = 5
@ -3995,7 +4002,7 @@ def sendBlockViaServer(baseDir: str, session,
displayName) = getPersonBox(baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox, 72652)
if not inboxUrl:
if debug:
@ -4077,7 +4084,7 @@ def sendUndoBlockViaServer(baseDir: str, session,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(baseDir, session, wfRequest, personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox, 53892)
if not inboxUrl:
if debug:

View File

@ -316,7 +316,8 @@ def sendRoleViaServer(baseDir: str, session,
wfRequest, personCache,
projectVersion, httpPrefix,
delegatorNickname,
delegatorDomain, postToBox)
delegatorDomain, postToBox,
765672)
if not inboxUrl:
if debug:

View File

@ -376,7 +376,8 @@ def sendShareViaServer(baseDir, session,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox,
83653)
if not inboxUrl:
if debug:
@ -474,7 +475,8 @@ def sendUndoShareViaServer(baseDir: str, session,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, fromNickname,
fromDomain, postToBox)
fromDomain, postToBox,
12663)
if not inboxUrl:
if debug:

View File

@ -152,7 +152,7 @@ def sendSkillViaServer(baseDir: str, session, nickname: str, password: str,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, nickname, domain,
postToBox)
postToBox, 86725)
if not inboxUrl:
if debug:

View File

@ -65,7 +65,8 @@ def instancesGraph(baseDir: str, handles: str,
avatarUrl, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
nickname, domain, 'outbox')
nickname, domain, 'outbox',
27261)
postDomains = \
getPostDomains(session, personUrl, 64, maxMentions, maxEmoji,
maxAttachments, federationList,

View File

@ -1179,7 +1179,8 @@ def individualPostAsHtml(allowDownloads: bool,
avatarUrl2, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
nickname, domain, 'outbox')
nickname, domain, 'outbox',
72367)
logPostTiming(enableTimingLog, postStartTime, '6')
if avatarUrl2:

View File

@ -1457,7 +1457,7 @@ def individualFollowAsHtml(translate: {},
avatarUrl2, displayName) = getPersonBox(baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, nickname,
domain, 'outbox')
domain, 'outbox', 43036)
if avatarUrl2:
avatarUrl = avatarUrl2
if displayName: