+ if (autoapprove && contacts[xid]!==undefined) {
+ // approve known address
+ approve = true;
+ console.log("Approve known Friendica contact "+xid+".");
+ }
+ else if (autoapprove && pstatus && pstatus.indexOf("Friendica")!=-1) {
+ // Unknown address claims to be a Friendica contact.
+ // This is probably because the other side knows our
+ // address, but we do not know the other side yet.
+ // But it's only a matter of time, so wait - do not
+ // approve yet and do not annoy the user by asking.
+ approve = false;
+ console.log("Do not approve unknown Friendica contact "+xid+" - wait instead.");
+ }
+ else {
+ // In all other cases, ask the user.
+ message = "Accept "+xid+" for chat?";
+ if (pstatus) message += "\n\nStatus:\n"+pstatus;
+ approve = confirm(message);
+ }