Merge pull request #2 from RocketChat/develop

Sync With RocketChat
pull/9435/head
Ramrami Mohamed 8 years ago committed by GitHub
commit ddfa728f12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/rocketchat-lib/server/functions/deleteUser.js
  2. 2
      packages/rocketchat-livechat/.app/client/lib/chatMessages.js
  3. 5
      packages/rocketchat-livechat/server/methods/sendMessageLivechat.js

@ -2,7 +2,7 @@ RocketChat.deleteUser = function(userId) {
const user = RocketChat.models.Users.findOneById(userId);
RocketChat.models.Messages.removeByUserId(userId); // Remove user messages
RocketChat.models.Subscriptions.findByUserId(userId).forEach((subscription) => {
RocketChat.models.Subscriptions.db.findByUserId(userId).forEach((subscription) => {
const room = RocketChat.models.Rooms.findOneById(subscription.rid);
if (room) {
if (room.t !== 'c' && room.usernames.length === 1) {

@ -116,7 +116,7 @@ this.ChatMessages = class ChatMessages {
const currentAgent = !visitor.roomSubscribed && Livechat.agent;
if (currentAgent) {
agent = {
_id: currentAgent._id,
agentId: currentAgent._id,
username: currentAgent.username
};
}

@ -7,6 +7,11 @@ Meteor.methods({
check(rid, String);
check(msg, String);
check(agent, Match.Maybe({
agentId: String,
username: String
}));
const guest = LivechatVisitors.getVisitorByToken(token, {
fields: {
name: 1,

Loading…
Cancel
Save