removed ES6 function calls

This commit is contained in:
Neto Becker
2016-01-15 11:59:44 -02:00
committed by meew0
parent 0164d3e7b5
commit b3d5197013
2 changed files with 13 additions and 4 deletions

View File

@@ -159,9 +159,14 @@ export default class Resolver {
}
if (resource instanceof User) {
// see if a PM exists
var chatFound = this.internal.private_channels.find(
pmchat => pmchat.recipient.equals(resource)
);
var chatFound = false;
for (var pmchat of this.internal.private_channels) {
if (pmchat.recipient.equals(resource)) {
chatFound = pmchat;
break;
}
}
if (chatFound) {
// a PM already exists!
return Promise.resolve(chatFound);