We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ee435f commit 9ee3856Copy full SHA for 9ee3856
1 file changed
api/server/collections/chats.ts
@@ -1,4 +1,10 @@
1
import { MongoObservable } from 'meteor-rxjs';
2
import { Chat } from '../models';
3
+import { Messages } from './messages';
4
5
export const Chats = new MongoObservable.Collection<Chat>('chats');
6
+
7
+// Dispose unused messages
8
+Chats.collection.after.remove(function (userId, doc) {
9
+ Messages.collection.remove({ chatId: doc._id });
10
+});
0 commit comments