Simplify and improve message format config
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user