From 0987f6ab3bf60dfd2f8b9942ab760f405205865f Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 16 Sep 2015 19:02:26 -0300 Subject: [PATCH] Replace all ChatSubscription.upsert --- server/methods/createDirectMessage.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/methods/createDirectMessage.coffee b/server/methods/createDirectMessage.coffee index 19fc833a0d0..0883f6a07d1 100644 --- a/server/methods/createDirectMessage.coffee +++ b/server/methods/createDirectMessage.coffee @@ -31,9 +31,9 @@ Meteor.methods ts: now # Make user I have a subcription to this room - ChatSubscription.upsert + RocketChat.models.Subscriptions.upsert rid: rid - $and: [{'u._id': me._id}] + 'u._id': me._id , $set: ts: now @@ -49,9 +49,9 @@ Meteor.methods username: me.username # Make user the target user has a subcription to this room - ChatSubscription.upsert + RocketChat.models.Subscriptions.upsert rid: rid - $and: [{'u._id': to._id}] + 'u._id': to._id , $setOnInsert: name: me.username