finish mailbox
This commit is contained in:
@@ -29,20 +29,13 @@ export class Mailbox implements Subscriber {
|
||||
return this.expiryDate < today;
|
||||
}
|
||||
|
||||
// init
|
||||
// manage
|
||||
constructor(ws: WS) {
|
||||
this.ws = ws;
|
||||
this.sendId();
|
||||
}
|
||||
|
||||
sendId(): void {
|
||||
if (!this.ws) return;
|
||||
|
||||
sendWebSocketMessage(
|
||||
{
|
||||
assignedMailboxId: this.id,
|
||||
},
|
||||
this.ws
|
||||
ws
|
||||
);
|
||||
}
|
||||
|
||||
@@ -57,6 +50,12 @@ export class Mailbox implements Subscriber {
|
||||
);
|
||||
}
|
||||
|
||||
delete(): void {
|
||||
subscriptionMap.deleteSubscriber(this);
|
||||
if (!this.ws) return;
|
||||
sendWebSocketMessage({ deletedMailbox: this.id }, this.ws);
|
||||
}
|
||||
|
||||
// storage
|
||||
messages = new Set<string>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user