summary refs log tree commit diff
path: root/synapse/storage/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-29 13:35:15 +0100
committerErik Johnston <erik@matrix.org>2014-09-29 13:35:15 +0100
commitf7d80930f21190355733da9ba7ab5068ce0702a8 (patch)
treecf66b7e28cfa49006c8e8ddae610f8371d2f7744 /synapse/storage/__init__.py
parentTrack the IP users connect with. Add an admin column to users table. (diff)
downloadsynapse-f7d80930f21190355733da9ba7ab5068ce0702a8.tar.xz
SYN-48: Track User-Agents as well as IPs for client devices.
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r--synapse/storage/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index d53c090a91..169a80dce4 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -294,13 +294,15 @@ class DataStore(RoomMemberStore, RoomStore,
 
         defer.returnValue(self.min_token)
 
-    def insert_client_ip(self, user, access_token, ip):
+    def insert_client_ip(self, user, access_token, ip, user_agent):
         return self._simple_insert(
             "user_ips",
             {
                 "user": user.to_string(),
                 "access_token": access_token,
-                "ip": ip
+                "ip": ip,
+                "user_agent": user_agent,
+                "last_used": int(self._clock.time()),
             }
         )