mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Record device_id in client_ips
Record the device_id when we add a client ip; it's somewhat redundant as we could get it via the access_token, but it will make querying rather easier.
This commit is contained in:
parent
053e83dafb
commit
ec041b335e
3 changed files with 34 additions and 8 deletions
|
@ -35,7 +35,7 @@ class ClientIpStore(SQLBaseStore):
|
|||
super(ClientIpStore, self).__init__(hs)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def insert_client_ip(self, user, access_token, ip, user_agent):
|
||||
def insert_client_ip(self, user, access_token, ip, user_agent, device_id):
|
||||
now = int(self._clock.time_msec())
|
||||
key = (user.to_string(), access_token, ip)
|
||||
|
||||
|
@ -59,6 +59,7 @@ class ClientIpStore(SQLBaseStore):
|
|||
"access_token": access_token,
|
||||
"ip": ip,
|
||||
"user_agent": user_agent,
|
||||
"device_id": device_id,
|
||||
},
|
||||
values={
|
||||
"last_seen": now,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue