# matrix-appservice-kakaotalk - A Matrix-KakaoTalk puppeting bridge. # Copyright (C) 2022 Tulir Asokan, Andrew Ferrazzutti # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . from typing import Optional, Union from attr import dataclass from mautrix.types import SerializableAttrs, JSON from ...bson import Long @dataclass class ProfileFeedObject(SerializableAttrs): type: str value: str @dataclass(kw_only=True) class ProfileFeed(SerializableAttrs): id: str serviceName: str typeIconUrl: str downloadId: str contents: list[ProfileFeedObject] url: str serviceUrl: Optional[str] = None # NOTE Made optional webUrl: str serviceWebUrl: Optional[str] = None # NOTE Made optional updatedAt: int cursor: int feedMessage: str permission: int type: int isCurrent: bool extra: JSON # instead of "unknown" @dataclass(kw_only=True) class ProfileFeedList(SerializableAttrs): totalCnt: int # NOTE Renamed from "totalCnts" feeds: list[ProfileFeed] @dataclass class ProfileDecorationObject(SerializableAttrs): resourceUrl: str @dataclass class ProfileDecoration(SerializableAttrs): itemKind: str itemId: str parameters: ProfileDecorationObject @dataclass class BgEffectDecoration(ProfileDecoration): itemKind = 'BgEffect' @dataclass class StickerDecoration(ProfileDecoration): itemKind = 'Sticker' x: int y: int cx: int cy: int width: int height: int rotation: int @dataclass class ProfileStruct(SerializableAttrs): backgroundImageUrl: str originalBackgroundImageUrl: str statusMessage: str profileImageUrl: str fullProfileImageUrl: str originalProfileImageUrl: str decoration: list[ProfileDecoration] profileFeeds: ProfileFeedList backgroundFeeds: ProfileFeedList allowStory: bool allowStoryPost: bool hasProfile2Photos: bool allowPay: bool screenToken: int # NEW nickname: str userId: Union[int, str, Long] # NOTE Should confirm this suspended: bool meBadge: bool # TODO feeds = {feeds: list, last: bool} @dataclass class ProfileReqStruct(SerializableAttrs): profile: ProfileStruct itemNewBadgeToken: int lastSeenAt: int ___all___ = [ "ProfileFeed", "ProfileFeedList", "ProfileDecoration", "BgEffectDecoration", "StickerDecoration", "ProfileStruct", "ProfileReqStruct", ]