mirror of
				https://github.com/matrix-org/synapse.git
				synced 2025-11-04 10:11:05 +01:00 
			
		
		
		
	Fix getting latest device IP for user with no devices
This commit is contained in:
		
							parent
							
								
									7c551ec445
								
							
						
					
					
						commit
						34840cdcef
					
				@ -90,6 +90,8 @@ class ClientIpStore(background_updates.BackgroundUpdateStore):
 | 
				
			|||||||
            are (user_id, device_id) tuples. The values are also dicts, with
 | 
					            are (user_id, device_id) tuples. The values are also dicts, with
 | 
				
			||||||
            keys giving the column names
 | 
					            keys giving the column names
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
 | 
					        if not devices:
 | 
				
			||||||
 | 
					            defer.returnValue({})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        res = yield self.runInteraction(
 | 
					        res = yield self.runInteraction(
 | 
				
			||||||
            "get_last_client_ip_by_device",
 | 
					            "get_last_client_ip_by_device",
 | 
				
			||||||
@ -110,6 +112,9 @@ class ClientIpStore(background_updates.BackgroundUpdateStore):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @classmethod
 | 
					    @classmethod
 | 
				
			||||||
    def _get_last_client_ip_by_device_txn(cls, txn, devices, retcols):
 | 
					    def _get_last_client_ip_by_device_txn(cls, txn, devices, retcols):
 | 
				
			||||||
 | 
					        if not devices:
 | 
				
			||||||
 | 
					            return []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        where_clauses = []
 | 
					        where_clauses = []
 | 
				
			||||||
        bindings = []
 | 
					        bindings = []
 | 
				
			||||||
        for (user_id, device_id) in devices:
 | 
					        for (user_id, device_id) in devices:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user