More debug

master
Bob Mottram 2019-07-15 19:29:30 +01:00
parent a55165c922
commit 18629c88a8
1 changed files with 12 additions and 0 deletions

View File

@ -792,6 +792,9 @@ def sendToNamedAddresses(session,baseDir: str, \
recipients.append(address) recipients.append(address)
if not recipients: if not recipients:
return return
if debug:
print('c2s sending to addresses: '+str(recipients))
# this is after the message has arrived at the server
clientToServer=False clientToServer=False
for address in recipients: for address in recipients:
toNickname=getNicknameFromActor(address) toNickname=getNicknameFromActor(address)
@ -800,6 +803,8 @@ def sendToNamedAddresses(session,baseDir: str, \
toDomain,toPort=getDomainFromActor(address) toDomain,toPort=getDomainFromActor(address)
if not toDomain: if not toDomain:
continue continue
if debug:
print('c2s sending from '+nickname+'@'+domain+' to '+toNickname+'@'+toDomain)
sendSignedJson(postJsonObject,session,baseDir, \ sendSignedJson(postJsonObject,session,baseDir, \
nickname,domain,port, \ nickname,domain,port, \
toNickname,toDomain,toPort, \ toNickname,toDomain,toPort, \
@ -818,12 +823,17 @@ def sendToFollowers(session,baseDir: str, \
""" """
if not postIsAddressedToFollowers(baseDir,nickname,domain, \ if not postIsAddressedToFollowers(baseDir,nickname,domain, \
port,httpPrefix,postJsonObject): port,httpPrefix,postJsonObject):
if debug:
print('Post is not addressed to followers')
return return
grouped=groupFollowersByDomain(baseDir,nickname,domain) grouped=groupFollowersByDomain(baseDir,nickname,domain)
if not grouped: if not grouped:
if debug:
print('Post to followers did not resolve any domains')
return return
# this is after the message has arrived at the server
clientToServer=False clientToServer=False
# for each instance # for each instance
@ -839,6 +849,8 @@ def sendToFollowers(session,baseDir: str, \
if len(followerHandles)>1: if len(followerHandles)>1:
nickname='inbox' nickname='inbox'
toNickname='inbox' toNickname='inbox'
if debug:
print('Sending from '+nickname+'@'+domain+' to '+toNickname+'@'+toDomain)
sendSignedJson(postJsonObject,session,baseDir, \ sendSignedJson(postJsonObject,session,baseDir, \
nickname,domain,port, \ nickname,domain,port, \
toNickname,toDomain,toPort, \ toNickname,toDomain,toPort, \