2022-08-10 00:00:55 +10:00
|
|
|
from dataclasses import dataclass, field
|
2022-02-24 16:27:55 +11:00
|
|
|
|
2022-08-10 00:00:55 +10:00
|
|
|
@dataclass
|
2022-02-24 16:27:55 +11:00
|
|
|
class Account():
|
|
|
|
mxid:str
|
|
|
|
username:str
|
|
|
|
homeserver:str
|
|
|
|
avatar_url:str=''
|
|
|
|
nickname:str=''
|
|
|
|
rooms:List[Room]=field(default_factory=list)
|
|
|
|
|
2022-08-10 00:00:55 +10:00
|
|
|
@dataclass
|
2022-02-24 16:27:55 +11:00
|
|
|
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)
|
|
|
|
|
2022-08-10 00:00:55 +10:00
|
|
|
@dataclass
|
2022-02-24 16:27:55 +11:00
|
|
|
class Space(Room):
|
|
|
|
children:List[Room]=field(default_factory=list)
|
|
|
|
|
2022-08-10 00:00:55 +10:00
|
|
|
@dataclass
|
2022-02-24 16:27:55 +11:00
|
|
|
class Message():
|
|
|
|
id:str
|
|
|
|
contents:str
|
|
|
|
author:Member
|
|
|
|
|
2022-08-10 00:00:55 +10:00
|
|
|
@dataclass
|
2022-02-24 16:27:55 +11:00
|
|
|
class User():
|
|
|
|
mxid:str
|
|
|
|
nick:str
|
|
|
|
avatar:str
|
|
|
|
|
2022-08-10 00:00:55 +10:00
|
|
|
@dataclass
|
2022-02-24 16:27:55 +11:00
|
|
|
class Member(User):
|
|
|
|
room_av:str
|
|
|
|
room_nick:str
|