1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-25 18:52:20 -05:00

fix some muc related issues

This commit is contained in:
Lance Stout 2013-10-08 08:03:58 -07:00
parent 58765c20a0
commit bbd8f6aad0
4 changed files with 12 additions and 11 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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
}
});
},

View File

@ -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'
});
}