mirror of
				https://github.com/element-hq/synapse.git
				synced 2025-11-03 00:03:21 -05:00 
			
		
		
		
	Remove local threepids on account deactivation (#6426)
This commit is contained in:
		
							parent
							
								
									c48ea98007
								
							
						
					
					
						commit
						a9c44d4008
					
				
							
								
								
									
										1
									
								
								changelog.d/6426.bugfix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								changelog.d/6426.bugfix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
Clean up local threepids from user on account deactivation.
 | 
			
		||||
@ -95,6 +95,9 @@ class DeactivateAccountHandler(BaseHandler):
 | 
			
		||||
                user_id, threepid["medium"], threepid["address"]
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
        # Remove all 3PIDs this user has bound to the homeserver
 | 
			
		||||
        yield self.store.user_delete_threepids(user_id)
 | 
			
		||||
 | 
			
		||||
        # delete any devices belonging to the user, which will also
 | 
			
		||||
        # delete corresponding access tokens.
 | 
			
		||||
        yield self._device_handler.delete_all_devices_for_user(user_id)
 | 
			
		||||
 | 
			
		||||
@ -569,6 +569,19 @@ class RegistrationWorkerStore(SQLBaseStore):
 | 
			
		||||
        return self._simple_delete(
 | 
			
		||||
            "user_threepids",
 | 
			
		||||
            keyvalues={"user_id": user_id, "medium": medium, "address": address},
 | 
			
		||||
            desc="user_delete_threepid",
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def user_delete_threepids(self, user_id: str):
 | 
			
		||||
        """Delete all threepid this user has bound
 | 
			
		||||
 | 
			
		||||
        Args:
 | 
			
		||||
             user_id: The user id to delete all threepids of
 | 
			
		||||
 | 
			
		||||
        """
 | 
			
		||||
        return self._simple_delete(
 | 
			
		||||
            "user_threepids",
 | 
			
		||||
            keyvalues={"user_id": user_id},
 | 
			
		||||
            desc="user_delete_threepids",
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user