Fix some mistakes and remove all references for ChatRoom

pull/822/head
Rodrigo Nascimento 10 years ago
parent eafaabcbb9
commit 2beff30027
  1. 2
      packages/rocketchat-irc/irc.server.coffee
  2. 3
      packages/rocketchat-lib/server/models/Rooms.coffee
  3. 2
      packages/rocketchat-statistics/server/functions/get.coffee
  4. 1
      server/lib/collections.coffee
  5. 2
      server/methods/createDirectMessage.coffee
  6. 2
      server/methods/deleteUser.coffee
  7. 2
      server/startup/migrations/v6.coffee
  8. 2
      server/startup/migrations/v9.coffee

@ -300,7 +300,7 @@ class IrcClient
console.log '[irc] createDirectRoomWhenNotExist -> '.yellow, 'source:', source, 'target:', target
rid = [source._id, target._id].sort().join('')
now = new Date()
ChatRoom.RocketChat.models.Rooms.upsert
RocketChat.models.Rooms.upsert
_id: rid
,
$set:

@ -1,7 +1,6 @@
RocketChat.models.Rooms = new class asd extends RocketChat.models._Base
constructor: ->
# @model = new Meteor.Collection 'rocketchat_room'
@model = @ChatRoom
@model = new Meteor.Collection 'rocketchat_room'
@tryEnsureIndex { 'name': 1 }, { unique: 1, sparse: 1 }
@tryEnsureIndex { 'u._id': 1 }

@ -49,7 +49,7 @@ RocketChat.statistics.get = ->
v.avg = v.sum / v.count
return v
result = ChatRoom.mapReduce(m, r, { finalize: f, out: "rocketchat_mr_statistics" })
result = RocketChat.models.Rooms.model.mapReduce(m, r, { finalize: f, out: "rocketchat_mr_statistics" })
statistics.maxRoomUsers = 0
statistics.avgChannelUsers = 0

@ -1,4 +1,3 @@
@ChatMessage = new Meteor.Collection 'rocketchat_message'
@ChatRoom = new Meteor.Collection 'rocketchat_room'
@MapReducedStatistics = new Mongo.Collection 'rocketchat_mr_statistics'
@ChatReports = new Meteor.Collection 'rocketchat_reports'

@ -20,7 +20,7 @@ Meteor.methods
now = new Date()
# Make sure we have a room
ChatRoom.RocketChat.models.Rooms.upsert
RocketChat.models.Rooms.upsert
_id: rid
,
$set:

@ -25,7 +25,7 @@ Meteor.methods
rooms = RocketChat.models.Rooms.findByUserId(userId).fetch()
ChatRoom.RocketChat.models.Rooms.removeByTypeContainingUsername 'd', user.username # Remove direct rooms with the user
RocketChat.models.Rooms.removeByTypeContainingUsername 'd', user.username # Remove direct rooms with the user
RocketChat.models.Rooms.removeUsernameFromAll user.username # Remove user from all other rooms
RocketChat.models.Users.removeById userId # Remove user from users database

@ -10,7 +10,7 @@ Meteor.startup ->
ChatMessage.update({'rid':room._id},{'$set':{'rid':'GENERAL'}},{'multi':1})
RocketChat.models.Rooms.removeById(room._id)
delete room._id
ChatRoom.RocketChat.models.Rooms.upsert({'_id':'GENERAL'},{$set: room})
RocketChat.models.Rooms.upsert({'_id':'GENERAL'},{$set: room})
console.log 'End'

@ -8,7 +8,7 @@ Meteor.startup ->
toMigrate = [
{
source: new Meteor.Collection 'data.ChatRoom'
target: ChatRoom
target: RocketChat.models.Rooms.model
}
{
source: new Meteor.Collection 'data.ChatSubscription'

Loading…
Cancel
Save