rintrix/models.py

39 lines
653 B
Python

from dataclasses import dataclass, field
@dataclass
class Account():
mxid:str
username:str
homeserver:str
avatar_url:str=''
nickname:str=''
rooms:List[Room]=field(default_factory=list)
@dataclass
class Room():
id:str
name:str=''
members:List[Member]=field(default_factory=list)
parents:List[Space]=field(default_factory=list)
messages:List[Message]=field(default_factory=list)
@dataclass
class Space(Room):
children:List[Room]=field(default_factory=list)
@dataclass
class Message():
id:str
contents:str
author:Member
@dataclass
class User():
mxid:str
nick:str
avatar:str
@dataclass
class Member(User):
room_av:str
room_nick:str