Skip to content

Commit

Permalink
Set 'rockat.cat' as the _id of user rocket.cat
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Dec 10, 2015
1 parent a144ffe commit f8c356d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/startup/initialData.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Meteor.startup ->
RocketChat.models.Rooms.createWithIdTypeAndName 'GENERAL', 'c', 'general',
default: true

if not RocketChat.models.Users.findOneByUsername('rocket.cat')?
userId = RocketChat.models.Users.create
if not RocketChat.models.Users.findOneById('rocket.cat')?
RocketChat.models.Users.create
_id: 'rocket.cat'
name: "Rocket.Cat"
username: 'rocket.cat'
status: "offline"
Expand All @@ -19,7 +20,7 @@ Meteor.startup ->
RocketChatFileAvatarInstance.deleteFile "rocket.cat.jpg"
ws = RocketChatFileAvatarInstance.createWriteStream "rocket.cat.jpg", 'image/png'
ws.on 'end', Meteor.bindEnvironment ->
RocketChat.models.Users.setAvatarOrigin userId, 'local'
RocketChat.models.Users.setAvatarOrigin 'rocket.cat', 'local'

rs.pipe(ws)

Expand Down

0 comments on commit f8c356d

Please sign in to comment.