2019-04-30 13:51:37 +10:00
|
|
|
from typing import Any, Dict, List, Optional
|
2019-04-12 18:33:09 +10:00
|
|
|
|
2019-04-30 13:51:37 +10:00
|
|
|
from PyQt5.QtCore import QDateTime
|
2019-04-12 18:33:09 +10:00
|
|
|
|
2019-04-30 13:51:37 +10:00
|
|
|
from .list_item import ListItem
|
2019-04-21 07:36:21 +10:00
|
|
|
|
|
|
|
|
|
|
|
class User(ListItem):
|
2019-04-30 13:51:37 +10:00
|
|
|
_required_init_values = {"userId"}
|
|
|
|
_constant = {"userId"}
|
2019-04-21 07:36:21 +10:00
|
|
|
|
2019-04-30 13:51:37 +10:00
|
|
|
userId: str = ""
|
|
|
|
displayName: Optional[str] = None
|
|
|
|
avatarUrl: Optional[str] = None
|
|
|
|
statusMessage: Optional[str] = None
|
2019-04-21 07:36:21 +10:00
|
|
|
|
|
|
|
|
|
|
|
class Room(ListItem):
|
2019-04-30 13:51:37 +10:00
|
|
|
_required_init_values = {"roomId", "displayName"}
|
|
|
|
_constant = {"roomId"}
|
2019-04-21 07:36:21 +10:00
|
|
|
|
2019-04-30 13:51:37 +10:00
|
|
|
roomId: str = ""
|
|
|
|
displayName: str = ""
|
|
|
|
category: str = "Rooms"
|
|
|
|
topic: Optional[str] = None
|
|
|
|
typingUsers: List[str] = []
|
|
|
|
inviter: Optional[Dict[str, str]] = None
|
|
|
|
leftEvent: Optional[Dict[str, str]] = None
|
2019-04-21 07:36:21 +10:00
|
|
|
|
|
|
|
|
|
|
|
class RoomEvent(ListItem):
|
2019-04-30 13:51:37 +10:00
|
|
|
_required_init_values = {"type", "dict"}
|
|
|
|
_constant = {"type"}
|
2019-04-21 07:36:21 +10:00
|
|
|
|
2019-04-30 13:51:37 +10:00
|
|
|
type: str = ""
|
|
|
|
dict: Dict[str, Any] = {}
|
|
|
|
dateTime: QDateTime = QDateTime.currentDateTime()
|
|
|
|
isLocalEcho: bool = False
|