Browse Source

fixed room description bug

Akira Laine 9 years ago
parent
commit
701b4a4f6e
1 changed files with 8 additions and 6 deletions
  1. 8 6
      app/server/server.js

+ 8 - 6
app/server/server.js

@@ -13,7 +13,7 @@ Meteor.startup(function () {
     var stations = [{tag: "edm", display: "EDM"}, {tag: "pop", display: "Pop"}]; //Rooms to be set on server startup
     for (var i in stations) {
         if (Rooms.find({type: stations[i]}).count() === 0) {
-            createRoom(stations[i].display, stations[i].tag, false);
+            createRoom(stations[i].display, stations[i].tag, false, "Room description.");
         }
     }
     emojione.ascii = true;
@@ -118,7 +118,7 @@ function getStation(type, cb) {
     });
 }
 
-function createRoom(display, tag, private) {
+function createRoom(display, tag, private, desc) {
     var type = tag;
     if (Rooms.find({type: type}).count() === 0) {
         Rooms.insert({
@@ -126,7 +126,8 @@ function createRoom(display, tag, private) {
             type: type,
             users: 0,
             private: private,
-            currentSong: {song: default_song, started: 0}
+            currentSong: {song: default_song, started: 0},
+            roomDesc: desc
         }, function (err) {
             if (err) {
                 throw err;
@@ -1004,7 +1005,8 @@ Meteor.methods({
                 "id": newSong.id,
                 "img": newSong.img,
                 "duration": newSong.duration,
-                "skipDuration": newSong.skipDuration
+                "skipDuration": newSong.skipDuration,
+                "approvedBy": Meteor.userId()
         }}, function(err) {
                 console.log(err);
                 if (err) {
@@ -1069,9 +1071,9 @@ Meteor.methods({
             throw new Meteor.Error(403, "Invalid permissions.");
         }
     },
-    createRoom: function (display, tag, private) {
+    createRoom: function (display, tag, private, desc) {
         if (isAdmin() && !isBanned()) {
-            createRoom(display, tag, private);
+            createRoom(display, tag, private, desc);
         } else {
             throw new Meteor.Error(403, "Invalid permissions.");
         }