Simplify and improve message format config

This commit is contained in:
Tulir Asokan
2018-06-23 23:46:41 +03:00
parent f473c02bc3
commit ad23445b69
4 changed files with 42 additions and 56 deletions
+6 -2
View File
@@ -64,11 +64,15 @@ class User(AbstractUser):
return self.mxid
@property
def displayname(self):
# TODO show better username
def mxid_localpart(self):
match = re.compile("@(.+):(.+)").match(self.mxid)
return match.group(1)
@property
def displayname(self):
# TODO show better display name
return self.mxid_localpart
@property
def db_contacts(self):
return [self.db.merge(DBContact(user=self.tgid, contact=puppet.id))