From af919974d7d36fa0728cebf058e592ac67aca144 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 18 Dec 2020 17:49:17 +0000 Subject: [PATCH] Trace parameter --- announce.py | 2 +- availability.py | 2 +- bookmarks.py | 4 ++-- delete.py | 2 +- follow.py | 5 +++-- like.py | 5 +++-- posts.py | 35 +++++++++++++++++++++-------------- roles.py | 3 ++- shares.py | 6 ++++-- skills.py | 2 +- socnet.py | 3 ++- webapp_post.py | 3 ++- webapp_profile.py | 2 +- 13 files changed, 44 insertions(+), 30 deletions(-) diff --git a/announce.py b/announce.py index 386a6386..45be9351 100644 --- a/announce.py +++ b/announce.py @@ -369,7 +369,7 @@ def sendAnnounceViaServer(baseDir: str, session, personCache, projectVersion, httpPrefix, fromNickname, fromDomain, - postToBox) + postToBox, 73528) if not inboxUrl: if debug: diff --git a/availability.py b/availability.py index b7739e86..1dc7b03c 100644 --- a/availability.py +++ b/availability.py @@ -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: diff --git a/bookmarks.py b/bookmarks.py index c0ef808a..75eeac47 100644 --- a/bookmarks.py +++ b/bookmarks.py @@ -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: diff --git a/delete.py b/delete.py index 8302da1e..524004d8 100644 --- a/delete.py +++ b/delete.py @@ -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: diff --git a/follow.py b/follow.py index 58c1dfb6..441d02fd 100644 --- a/follow.py +++ b/follow.py @@ -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: diff --git a/like.py b/like.py index 6076c729..7f59e616 100644 --- a/like.py +++ b/like.py @@ -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: diff --git a/posts.py b/posts.py index 96f8ded4..2f629d53 100644 --- a/posts.py +++ b/posts.py @@ -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: diff --git a/roles.py b/roles.py index ecbf237b..a03a34ba 100644 --- a/roles.py +++ b/roles.py @@ -316,7 +316,8 @@ def sendRoleViaServer(baseDir: str, session, wfRequest, personCache, projectVersion, httpPrefix, delegatorNickname, - delegatorDomain, postToBox) + delegatorDomain, postToBox, + 765672) if not inboxUrl: if debug: diff --git a/shares.py b/shares.py index 1926395a..cb0867cb 100644 --- a/shares.py +++ b/shares.py @@ -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: diff --git a/skills.py b/skills.py index 2b4930ff..2637acd7 100644 --- a/skills.py +++ b/skills.py @@ -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: diff --git a/socnet.py b/socnet.py index 31c59eb8..36b5c7cb 100644 --- a/socnet.py +++ b/socnet.py @@ -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, diff --git a/webapp_post.py b/webapp_post.py index 5ad02932..28891dca 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -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: diff --git a/webapp_profile.py b/webapp_profile.py index c18c8794..f2f2a120 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -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: