Handles chat message timestamps according to XEP-0091 and updates app.bundle.js.
This commit is contained in:
parent
7a54537bee
commit
239f271caf
|
@ -19,7 +19,7 @@
|
|||
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
|
||||
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
|
||||
<script src="interface_config.js?v=5"></script>
|
||||
<script src="libs/app.bundle.js?v=89"></script>
|
||||
<script src="libs/app.bundle.js?v=90"></script>
|
||||
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
|
||||
<link rel="stylesheet" href="css/font.css?v=7"/>
|
||||
<link rel="stylesheet" href="css/toastr.css?v=1">
|
||||
|
|
1146
libs/app.bundle.js
1146
libs/app.bundle.js
File diff suppressed because it is too large
Load Diff
|
@ -385,11 +385,24 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
}
|
||||
}
|
||||
|
||||
// xep-0203 delay
|
||||
var stamp = $(msg).find('>delay').attr('stamp');
|
||||
|
||||
if (!stamp) {
|
||||
// or xep-0091 delay, UTC timestamp
|
||||
stamp = $(msg).find('>[xmlns="jabber:x:delay"]').attr('stamp');
|
||||
|
||||
if (stamp) {
|
||||
// the format is CCYYMMDDThh:mm:ss
|
||||
var dateParts = stamp.match(/(\d{4})(\d{2})(\d{2}T\d{2}:\d{2}:\d{2})/);
|
||||
stamp = dateParts[1] + "-" + dateParts[2] + "-" + dateParts[3] + "Z";
|
||||
}
|
||||
}
|
||||
|
||||
if (txt) {
|
||||
console.log('chat', nick, txt);
|
||||
eventEmitter.emit(XMPPEvents.MESSAGE_RECEIVED,
|
||||
from, nick, txt, this.myroomjid, $(msg).find('>delay').attr('stamp'));
|
||||
from, nick, txt, this.myroomjid, stamp);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue