summary refs log tree commit diff
path: root/synapse/storage/profile.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2017-11-29 18:27:05 +0000
committerMatthew Hodgson <matthew@matrix.org>2017-11-29 18:27:05 +0000
commit3241c7aac3dc114a6abce46e5d241f42ed35a7fe (patch)
tree81dc0c83a96b1f0a720c8fc3f73c40bea0c0a03c /synapse/storage/profile.py
parentAdd user_directory_include_pattern config param to expand search results to a... (diff)
downloadsynapse-3241c7aac3dc114a6abce46e5d241f42ed35a7fe.tar.xz
untested WIP but might actually work
Diffstat (limited to 'synapse/storage/profile.py')
-rw-r--r--synapse/storage/profile.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/storage/profile.py b/synapse/storage/profile.py
index beea3102fc..484ad59b62 100644
--- a/synapse/storage/profile.py
+++ b/synapse/storage/profile.py
@@ -15,6 +15,8 @@
 
 from twisted.internet import defer
 
+from synapse.storage.roommember import ProfileInfo
+
 from ._base import SQLBaseStore
 
 
@@ -26,6 +28,18 @@ class ProfileStore(SQLBaseStore):
             desc="create_profile",
         )
 
+    def get_profileinfo(self, user_localpart):
+        profile = self._simple_select_one(
+            table="profiles",
+            keyvalues={"user_id": user_localpart},
+            retcols=("displayname", "avatar_url"),
+            desc="get_profileinfo",
+        )
+        return ProfileInfo(
+            avatar_url=profile.avatar_url,
+            displayname=profile.displayname,
+        )
+
     def get_profile_displayname(self, user_localpart):
         return self._simple_select_one_onecol(
             table="profiles",