forked from cory/tildefriends
Fixes chat encoding problems.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3362 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -15,7 +15,8 @@
|
||||
//! ]
|
||||
//! },
|
||||
//! "require": [
|
||||
//! "libchat"
|
||||
//! "libchat",
|
||||
//! "libencoding"
|
||||
//! ]
|
||||
//! }
|
||||
|
||||
@ -683,6 +684,7 @@ XmlStanzaParser.prototype.parseNode = function(node) {
|
||||
// end xmpp.js
|
||||
|
||||
let ChatService = require("libchat").ChatService;
|
||||
require("libencoding");
|
||||
|
||||
var gPingCount = 0;
|
||||
|
||||
@ -735,10 +737,12 @@ class XmppService {
|
||||
self._socket.onError(self._reportError);
|
||||
self._socket.read(function(data) {
|
||||
try {
|
||||
print(data.__prototype__ ? "YEAH!" : "nope");
|
||||
if (!data) {
|
||||
self._service.notifyStateChanged("disconnected");
|
||||
return;
|
||||
}
|
||||
data = new TextDecoder("UTF-8").decode(new Uint8Array(Object.values(data)));
|
||||
parse.parse(data).forEach(function(stanza) {
|
||||
if (stanza.name == "stream:features") {
|
||||
if (!started) {
|
||||
|
Reference in New Issue
Block a user