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:
parent
58765c20a0
commit
bbd8f6aad0
@ -9,6 +9,7 @@ var uuid = require('node-uuid');
|
|||||||
var Contact = require('../models/contact');
|
var Contact = require('../models/contact');
|
||||||
var Resource = require('../models/resource');
|
var Resource = require('../models/resource');
|
||||||
var Message = require('../models/message');
|
var Message = require('../models/message');
|
||||||
|
var attachMediaStream = require('attachmediastream');
|
||||||
|
|
||||||
|
|
||||||
var discoCapsQueue = async.queue(function (pres, cb) {
|
var discoCapsQueue = async.queue(function (pres, cb) {
|
||||||
@ -289,7 +290,7 @@ module.exports = function (client, app) {
|
|||||||
var msg = carbon.carbonReceived.forwarded.message;
|
var msg = carbon.carbonReceived.forwarded.message;
|
||||||
var delay = carbon.carbonReceived.forwarded.delay;
|
var delay = carbon.carbonReceived.forwarded.delay;
|
||||||
if (!delay.stamp) {
|
if (!delay.stamp) {
|
||||||
delay.stamp = Date.now();
|
delay.stamp = new Date(Date.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg._extensions.delay) {
|
if (!msg._extensions.delay) {
|
||||||
@ -305,7 +306,7 @@ module.exports = function (client, app) {
|
|||||||
var msg = carbon.carbonSent.forwarded.message;
|
var msg = carbon.carbonSent.forwarded.message;
|
||||||
var delay = carbon.carbonSent.forwarded.delay;
|
var delay = carbon.carbonSent.forwarded.delay;
|
||||||
if (!delay.stamp) {
|
if (!delay.stamp) {
|
||||||
delay.stamp = Date.now();
|
delay.stamp = new Date(Date.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg._extensions.delay) {
|
if (!msg._extensions.delay) {
|
||||||
|
@ -8,7 +8,7 @@ var htmlify = require('../helpers/htmlify');
|
|||||||
|
|
||||||
module.exports = HumanModel.define({
|
module.exports = HumanModel.define({
|
||||||
initialize: function (attrs) {
|
initialize: function (attrs) {
|
||||||
this._created = Date.now();
|
this._created = new Date(Date.now());
|
||||||
},
|
},
|
||||||
type: 'message',
|
type: 'message',
|
||||||
props: {
|
props: {
|
||||||
@ -138,7 +138,7 @@ module.exports = HumanModel.define({
|
|||||||
delete msg.id;
|
delete msg.id;
|
||||||
|
|
||||||
this.set(msg);
|
this.set(msg);
|
||||||
this._created = Date.now();
|
this._created = new Date(Date.now());
|
||||||
this.edited = true;
|
this.edited = true;
|
||||||
|
|
||||||
this.save();
|
this.save();
|
||||||
|
@ -84,8 +84,8 @@ module.exports = HumanModel.define({
|
|||||||
}
|
}
|
||||||
client.joinRoom(this.jid, this.nick, {
|
client.joinRoom(this.jid, this.nick, {
|
||||||
history: {
|
history: {
|
||||||
maxstanzas: 20,
|
maxstanzas: 50
|
||||||
since: this.lastInteraction
|
//since: this.lastInteraction
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -28,14 +28,14 @@ module.exports = BasePage.extend({
|
|||||||
show: function (animation) {
|
show: function (animation) {
|
||||||
BasePage.prototype.show.apply(this, [animation]);
|
BasePage.prototype.show.apply(this, [animation]);
|
||||||
client.sendMessage({
|
client.sendMessage({
|
||||||
to: this.model.lockedResource || this.model.jid,
|
to: this.model.jid,
|
||||||
chatState: 'active'
|
chatState: 'active'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
hide: function () {
|
hide: function () {
|
||||||
BasePage.prototype.hide.apply(this);
|
BasePage.prototype.hide.apply(this);
|
||||||
client.sendMessage({
|
client.sendMessage({
|
||||||
to: this.model.lockedResource || this.model.jid,
|
to: this.model.jid,
|
||||||
chatState: 'inactive'
|
chatState: 'inactive'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -69,7 +69,7 @@ module.exports = BasePage.extend({
|
|||||||
if (!this.typing) {
|
if (!this.typing) {
|
||||||
this.typing = true;
|
this.typing = true;
|
||||||
client.sendMessage({
|
client.sendMessage({
|
||||||
to: this.model.lockedResource || this.model.jid,
|
to: this.model.jid,
|
||||||
chatState: 'composing'
|
chatState: 'composing'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ module.exports = BasePage.extend({
|
|||||||
if (this.typing && this.$chatInput.val().length === 0) {
|
if (this.typing && this.$chatInput.val().length === 0) {
|
||||||
this.typing = false;
|
this.typing = false;
|
||||||
client.sendMessage({
|
client.sendMessage({
|
||||||
to: this.model.lockedResource || this.model.jid,
|
to: this.model.jid,
|
||||||
chatState: 'active'
|
chatState: 'active'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ module.exports = BasePage.extend({
|
|||||||
if (this.typing) {
|
if (this.typing) {
|
||||||
this.typing = false;
|
this.typing = false;
|
||||||
client.sendMessage({
|
client.sendMessage({
|
||||||
to: this.model.lockedResource || this.model.jid,
|
to: this.model.jid,
|
||||||
chatState: 'paused'
|
chatState: 'paused'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user