remove comments
This commit is contained in:
parent
362ac98f6a
commit
a1a933c272
|
@ -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()
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -267,9 +267,6 @@ export class Community {
|
|||
this.contentTopic,
|
||||
this.symmetricKey
|
||||
)
|
||||
|
||||
// todo?:
|
||||
// this.client.activityCenter.addJoiningRequestNotification(...)
|
||||
}
|
||||
|
||||
public isOwner = (
|
||||
|
|
Loading…
Reference in New Issue