Skip to content
Snippets Groups Projects
Commit c6f5aaf3 authored by Diego Sampaio's avatar Diego Sampaio
Browse files

reverting some unwanted changes

parent 7d7be622
No related branches found
No related tags found
No related merge requests found
build.sh 0 → 100644
#!/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) -> ...@@ -54,31 +54,6 @@ RocketChat.sendMessage = (user, message, room, options) ->
if not room.t? or room.t is 'd' 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 Update the other subscriptions
### ###
......
...@@ -49,6 +49,21 @@ Meteor.methods ...@@ -49,6 +49,21 @@ Meteor.methods
_id: me._id _id: me._id
username: me.username 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 { return {
rid: rid rid: rid
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment