2019-04-12 18:33:09 +10:00
|
|
|
# Copyright 2019 miruka
|
|
|
|
# This file is part of harmonyqml, licensed under GPLv3.
|
|
|
|
|
2019-04-15 02:56:30 +10:00
|
|
|
from typing import Dict, NamedTuple, Optional
|
2019-04-12 18:33:09 +10:00
|
|
|
|
|
|
|
from PyQt5.QtCore import QDateTime
|
|
|
|
|
2019-04-15 02:56:30 +10:00
|
|
|
from .enums import Activity, Presence
|
2019-04-12 18:33:09 +10:00
|
|
|
|
|
|
|
|
|
|
|
class User(NamedTuple):
|
|
|
|
user_id: str
|
|
|
|
display_name: str
|
|
|
|
avatar_url: Optional[str] = None
|
|
|
|
status_message: Optional[str] = None
|
|
|
|
|
|
|
|
|
|
|
|
class Room(NamedTuple):
|
|
|
|
room_id: str
|
2019-04-13 22:59:10 +10:00
|
|
|
display_name: Optional[str]
|
2019-04-12 18:33:09 +10:00
|
|
|
description: str = ""
|
|
|
|
unread_messages: int = 0
|
|
|
|
presence: Presence = Presence.none
|
|
|
|
activity: Activity = Activity.none
|
|
|
|
last_activity_timestamp_ms: Optional[int] = None
|
|
|
|
avatar_url: Optional[str] = None
|
|
|
|
|
|
|
|
|
2019-04-15 02:56:30 +10:00
|
|
|
class RoomEvent(NamedTuple):
|
|
|
|
type: str
|
|
|
|
date_time: QDateTime
|
|
|
|
dict: Dict[str, str]
|