remove comments

This commit is contained in:
Felicio Mununga 2022-08-24 11:26:50 +02:00
parent 362ac98f6a
commit a1a933c272
No known key found for this signature in database
GPG Key ID: 0EB8D75C775AB6F1
3 changed files with 2 additions and 14 deletions

View File

@ -1,11 +1,9 @@
// todo: rename to notifications (center?), inbox, or keep same as other platforms
import type { ChatMessage } from './chat'
import type { Client } from './client'
// todo?: union
// todo?: rename to Activity
type Notification = {
// fixme?: specify message type (message_reply)
type: 'message'
value: ChatMessage
isMention?: boolean
@ -15,12 +13,10 @@ type Notification = {
type ActivityCenterLatest = {
notifications: Notification[]
// todo?: rename count to mentionsAndRepliesCount
unreadChats: Map<string, { count: number }> // id, count (mentions, replies)
unreadChats: Map<string, { count: number }>
}
// todo?: rename to NotificationCenter
export class ActivityCenter {
// todo?: use client.account for mentions and replies, or in chat.ts
#client: Client
#notifications: Set<Notification>
@ -33,7 +29,6 @@ export class ActivityCenter {
this.#callbacks = new Set()
}
// todo?: rename to latest, change
public getLatest = (): ActivityCenterLatest => {
const notifications: Notification[] = []
const unreadChats: Map<string, { count: number }> = new Map()

View File

@ -35,9 +35,7 @@ export type ChatMessage = ChatMessageProto & {
type FetchedMessage = { messageId: string; timestamp?: Date }
// todo?: add isMuted prop, use as condition to add a message/notification to activity center or not
export class Chat {
// todo: use #
private readonly client: Client
#clock: bigint
@ -146,7 +144,6 @@ export class Chat {
return this.#messages.get(id)
}
// todo?: delete
public onChange = (callback: (description: CommunityChat) => void) => {
this.chatCallbacks.add(callback)
@ -318,7 +315,6 @@ export class Chat {
// callback
this.emitMessages()
// todo?: if not muted
if (!this.#isActive) {
this.client.activityCenter.addMessageNotification(
newMessage,

View File

@ -267,9 +267,6 @@ export class Community {
this.contentTopic,
this.symmetricKey
)
// todo?:
// this.client.activityCenter.addJoiningRequestNotification(...)
}
public isOwner = (