mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			More checking for actor updates
							parent
							
								
									d53bf9a5f7
								
							
						
					
					
						commit
						90417b5f8e
					
				
							
								
								
									
										13
									
								
								outbox.py
								
								
								
								
							
							
						
						
									
										13
									
								
								outbox.py
								
								
								
								
							| 
						 | 
				
			
			@ -62,7 +62,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {},
 | 
			
		|||
 | 
			
		||||
    if not messageJson.get('type'):
 | 
			
		||||
        return
 | 
			
		||||
    print("messageJson['type'] " + messageJson['type'])
 | 
			
		||||
    if not isinstance(messageJson['type'], str):
 | 
			
		||||
        if debug:
 | 
			
		||||
            print('DEBUG: c2s actor update type is not a string')
 | 
			
		||||
        return
 | 
			
		||||
    if messageJson['type'] != 'Update':
 | 
			
		||||
        return
 | 
			
		||||
    if not hasObjectDict(messageJson):
 | 
			
		||||
| 
						 | 
				
			
			@ -73,6 +76,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {},
 | 
			
		|||
        if debug:
 | 
			
		||||
            print('DEBUG: c2s actor update - no type')
 | 
			
		||||
        return
 | 
			
		||||
    if not isinstance(messageJson['object']['type'], str):
 | 
			
		||||
        if debug:
 | 
			
		||||
            print('DEBUG: c2s actor update object type is not a string')
 | 
			
		||||
        return
 | 
			
		||||
    if messageJson['object']['type'] != 'Person':
 | 
			
		||||
        if debug:
 | 
			
		||||
            print('DEBUG: not a c2s actor update')
 | 
			
		||||
| 
						 | 
				
			
			@ -89,6 +96,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {},
 | 
			
		|||
        if debug:
 | 
			
		||||
            print('DEBUG: c2s actor update has no id field')
 | 
			
		||||
        return
 | 
			
		||||
    if not isinstance(messageJson['id'], str):
 | 
			
		||||
        if debug:
 | 
			
		||||
            print('DEBUG: c2s actor update id is not a string')
 | 
			
		||||
        return
 | 
			
		||||
    actor = \
 | 
			
		||||
        httpPrefix + '://' + getFullDomain(domain, port) + '/users/' + nickname
 | 
			
		||||
    if len(messageJson['to']) != 1:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue