Replace findOne by findOneById

pull/4511/head
Rodrigo Nascimento 10 years ago
parent 1a1e0b5a6c
commit d8763ebb2d
No known key found for this signature in database
GPG Key ID: 2C85B3AFE75D23F9
  1. 2
      packages/rocketchat-lib/server/functions/sendMessage.coffee

@ -13,7 +13,7 @@ RocketChat.sendMessage = (user, message, room, upsert = false) ->
message.rid = room._id
if not room.usernames? || room.usernames.length is 0
room = RocketChat.models.Rooms.findOne({_id: room._id})
room = RocketChat.models.Rooms.findOneById(room._id)
if message.parseUrls isnt false
if urls = message.msg.match /([A-Za-z]{3,9}):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+=!:~%\/\.@\,\w]*)?\??([-\+=&!:;%@\/\.\,\w]+)?(?:#([^\s\)]+))?)?/g

Loading…
Cancel
Save