Merge pull request #157 from BeaudanBrown/loki-address-broadcast
Loki address broadcastpull/160/head
commit
9c98a1f654
@ -1,5 +1,6 @@
|
||||
{
|
||||
"storageProfile": "development1",
|
||||
"localServerPort": "8082",
|
||||
"disableAutoUpdate": true,
|
||||
"openDevTools": true
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
class LokiP2pAPI {
|
||||
constructor() {
|
||||
this.contactP2pDetails = {};
|
||||
}
|
||||
|
||||
addContactP2pDetails(pubKey, address, port) {
|
||||
this.contactP2pDetails[pubKey] = {
|
||||
address,
|
||||
port,
|
||||
};
|
||||
}
|
||||
|
||||
getContactP2pDetails(pubKey) {
|
||||
return this.contactP2pDetails[pubKey] || null;
|
||||
}
|
||||
|
||||
removeContactP2pDetails(pubKey) {
|
||||
delete this.contactP2pDetails[pubKey];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
LokiP2pAPI,
|
||||
};
|
@ -0,0 +1,22 @@
|
||||
/* global window */
|
||||
|
||||
// eslint-disable-next-line func-names
|
||||
(function() {
|
||||
// Possible conversation friend states
|
||||
const friendRequestStatusEnum = Object.freeze({
|
||||
// New conversation, no messages sent or received
|
||||
none: 0,
|
||||
// This state is used to lock the input early while sending
|
||||
pendingSend: 1,
|
||||
// Friend request sent, awaiting response
|
||||
requestSent: 2,
|
||||
// Friend request received, awaiting user input
|
||||
requestReceived: 3,
|
||||
// We did it!
|
||||
friends: 4,
|
||||
});
|
||||
|
||||
window.friends = {
|
||||
friendRequestStatusEnum,
|
||||
};
|
||||
})();
|
Loading…
Reference in New Issue