From bbd8f6aad01ce18d78056a087b9e32c46b75f610 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 8 Oct 2013 08:03:58 -0700 Subject: [PATCH] fix some muc related issues --- clientapp/helpers/xmppEventHandlers.js | 5 +++-- clientapp/models/message.js | 4 ++-- clientapp/models/muc.js | 4 ++-- clientapp/pages/groupchat.js | 10 +++++----- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/clientapp/helpers/xmppEventHandlers.js b/clientapp/helpers/xmppEventHandlers.js index 7e6cef1..ea49352 100644 --- a/clientapp/helpers/xmppEventHandlers.js +++ b/clientapp/helpers/xmppEventHandlers.js @@ -9,6 +9,7 @@ var uuid = require('node-uuid'); var Contact = require('../models/contact'); var Resource = require('../models/resource'); var Message = require('../models/message'); +var attachMediaStream = require('attachmediastream'); var discoCapsQueue = async.queue(function (pres, cb) { @@ -289,7 +290,7 @@ module.exports = function (client, app) { var msg = carbon.carbonReceived.forwarded.message; var delay = carbon.carbonReceived.forwarded.delay; if (!delay.stamp) { - delay.stamp = Date.now(); + delay.stamp = new Date(Date.now()); } if (!msg._extensions.delay) { @@ -305,7 +306,7 @@ module.exports = function (client, app) { var msg = carbon.carbonSent.forwarded.message; var delay = carbon.carbonSent.forwarded.delay; if (!delay.stamp) { - delay.stamp = Date.now(); + delay.stamp = new Date(Date.now()); } if (!msg._extensions.delay) { diff --git a/clientapp/models/message.js b/clientapp/models/message.js index 02ff7a0..a6ec487 100644 --- a/clientapp/models/message.js +++ b/clientapp/models/message.js @@ -8,7 +8,7 @@ var htmlify = require('../helpers/htmlify'); module.exports = HumanModel.define({ initialize: function (attrs) { - this._created = Date.now(); + this._created = new Date(Date.now()); }, type: 'message', props: { @@ -138,7 +138,7 @@ module.exports = HumanModel.define({ delete msg.id; this.set(msg); - this._created = Date.now(); + this._created = new Date(Date.now()); this.edited = true; this.save(); diff --git a/clientapp/models/muc.js b/clientapp/models/muc.js index a0ce7be..3b684bf 100644 --- a/clientapp/models/muc.js +++ b/clientapp/models/muc.js @@ -84,8 +84,8 @@ module.exports = HumanModel.define({ } client.joinRoom(this.jid, this.nick, { history: { - maxstanzas: 20, - since: this.lastInteraction + maxstanzas: 50 + //since: this.lastInteraction } }); }, diff --git a/clientapp/pages/groupchat.js b/clientapp/pages/groupchat.js index ff849dc..4ff9ed2 100644 --- a/clientapp/pages/groupchat.js +++ b/clientapp/pages/groupchat.js @@ -28,14 +28,14 @@ module.exports = BasePage.extend({ show: function (animation) { BasePage.prototype.show.apply(this, [animation]); client.sendMessage({ - to: this.model.lockedResource || this.model.jid, + to: this.model.jid, chatState: 'active' }); }, hide: function () { BasePage.prototype.hide.apply(this); client.sendMessage({ - to: this.model.lockedResource || this.model.jid, + to: this.model.jid, chatState: 'inactive' }); }, @@ -69,7 +69,7 @@ module.exports = BasePage.extend({ if (!this.typing) { this.typing = true; client.sendMessage({ - to: this.model.lockedResource || this.model.jid, + to: this.model.jid, chatState: 'composing' }); } @@ -81,7 +81,7 @@ module.exports = BasePage.extend({ if (this.typing && this.$chatInput.val().length === 0) { this.typing = false; client.sendMessage({ - to: this.model.lockedResource || this.model.jid, + to: this.model.jid, chatState: 'active' }); } @@ -113,7 +113,7 @@ module.exports = BasePage.extend({ if (this.typing) { this.typing = false; client.sendMessage({ - to: this.model.lockedResource || this.model.jid, + to: this.model.jid, chatState: 'paused' }); }