reverting some unwanted changes

pull/802/head
Diego Sampaio 10 years ago
parent 7d7be62247
commit c6f5aaf353
  1. 10
      build.sh
  2. 0
      packages/rocketchat-external/plugin/build-livechat.js
  3. 25
      packages/rocketchat-lib/server/sendMessage.coffee
  4. 15
      server/methods/createDirectMessage.coffee

@ -0,0 +1,10 @@
#!/bin/bash
source ./build-info.sh
export METEOR_SETTINGS=$(cat settings.json)
meteor add rocketchat:livechat
meteor add rocketchat:hubot
meteor build --server https://demo.rocket.chat --directory /var/www/rocket.chat
cd /var/www/rocket.chat/bundle/programs/server
npm install
cd /var/www/rocket.chat/current
pm2 startOrRestart /var/www/rocket.chat/current/pm2.json

@ -54,31 +54,6 @@ RocketChat.sendMessage = (user, message, room, options) ->
if not room.t? or room.t is 'd'
otherUser = null
if room.usernames[0]
room.usernames.some (username) ->
if username isnt user.username
otherUser = username
return true
to = Meteor.users.findOne { username: otherUser }, { fields: { _id: 1, username: 1 } }
# Make user the target user has a subcription to this room
ChatSubscription.upsert
rid: message.rid
$and: [{'u._id': to._id}]
,
$setOnInsert:
name: me.username
t: 'd'
open: false
alert: false
unread: 0
u:
_id: to._id
username: to.username
###
Update the other subscriptions
###

@ -49,6 +49,21 @@ Meteor.methods
_id: me._id
username: me.username
# Make user the target user has a subcription to this room
ChatSubscription.upsert
rid: rid
$and: [{'u._id': to._id}]
,
$setOnInsert:
name: me.username
t: 'd'
open: false
alert: false
unread: 0
u:
_id: to._id
username: to.username
return {
rid: rid
}

Loading…
Cancel
Save