Attempt to fix startPM

This commit is contained in:
abalabahaha
2016-03-11 22:12:15 -08:00
parent d2a9f15e82
commit ea80677a79
4 changed files with 4 additions and 16 deletions

View File

@@ -290,7 +290,6 @@ var Resolver = (function () {
}
if (resource instanceof _StructuresUser2["default"]) {
// see if a PM exists
var chatFound = false;
for (var _iterator3 = this.internal.private_channels, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
var _ref3;
@@ -306,15 +305,10 @@ var Resolver = (function () {
var pmchat = _ref3;
if (pmchat.recipient.equals(resource)) {
chatFound = pmchat;
break;
return Promise.resolve(pmchat);
}
}
if (chatFound) {
// a PM already exists!
return Promise.resolve(chatFound);
}
// PM does not exist :\
return this.internal.startPM(resource);
}