Built motion from commit 5e31ea4.|0.0.32
[motion.git] / server / api / xchatty / xchatty.socket.js
index ba5be29..b8ec557 100644 (file)
@@ -1 +1,24 @@
-var _0xade2=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x58\x63\x68\x61\x74\x74\x79","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x72\x65\x67\x69\x73\x74\x65\x72","\x78\x63\x68\x61\x74\x74\x79\x3A\x73\x61\x76\x65","\x65\x6D\x69\x74","\x78\x63\x68\x61\x74\x74\x79\x3A\x72\x65\x6D\x6F\x76\x65"];_0xade2[0];var xchatty=require(_0xade2[2])[_0xade2[1]];exports[_0xade2[3]]=function(_0x3724x2){};function onSave(_0x3724x2,_0x3724x4,_0x3724x5){_0x3724x2[_0xade2[5]](_0xade2[4],_0x3724x4)}function onRemove(_0x3724x2,_0x3724x4,_0x3724x5){_0x3724x2[_0xade2[5]](_0xade2[6],_0x3724x4)}
\ No newline at end of file
+/**
+ * Broadcast updates to client when the model changes
+ */
+
+'use strict';
+
+var xchatty = require('../../models').Xchatty;
+
+exports.register = function(socket) {
+  // xchatty.afterCreate(function (doc) {
+  //   onSave(socket, doc);
+  // });
+  // xchatty.afterDestroy(function (doc) {
+  //   onRemove(socket, doc);
+  // });
+}
+
+function onSave(socket, doc, cb) {
+  socket.emit('xchatty:save', doc);
+}
+
+function onRemove(socket, doc, cb) {
+  socket.emit('xchatty:remove', doc);
+}