diff --git a/app/sql.js b/app/sql.js index fdae69227..23fd7d40e 100644 --- a/app/sql.js +++ b/app/sql.js @@ -790,8 +790,8 @@ async function updateToLokiSchemaVersion1(currentVersion, instance) { ADD COLUMN serverId STRING;` ); - const initConversation = async (data) => { - let { id, type, name, friendRequestStatus } = data; + const initConversation = async data => { + const { id, type, name, friendRequestStatus } = data; await instance.run( `INSERT INTO conversations ( id, @@ -820,7 +820,7 @@ async function updateToLokiSchemaVersion1(currentVersion, instance) { $friendRequestStatus: friendRequestStatus, } ); - } + }; const baseData = { friendRequestStatus: 4, // Friends @@ -832,7 +832,7 @@ async function updateToLokiSchemaVersion1(currentVersion, instance) { unreadCount: 0, verified: 0, version: 2, - } + }; const publicChatData = { ...baseData, diff --git a/js/background.js b/js/background.js index dab134217..141218b5f 100644 --- a/js/background.js +++ b/js/background.js @@ -213,9 +213,7 @@ ); window.feeds = []; rssFeedConversations.forEach(conversation => { - window.feeds.push( - new window.LokiRssAPI(conversation.getRssSettings()) - ); + window.feeds.push(new window.LokiRssAPI(conversation.getRssSettings())); }); window.lokiMessageAPI = new window.LokiMessageAPI(ourKey); window.lokiPublicChatAPI = new window.LokiPublicChatAPI(ourKey); diff --git a/js/modules/loki_friend_request_status.js b/js/modules/loki_friend_request_status.js deleted file mode 100644 index c7896c0da..000000000 --- a/js/modules/loki_friend_request_status.js +++ /dev/null @@ -1,25 +0,0 @@ -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, - // Friend Request sent but timed out - requestExpired: 5, -}); - -// node and browser compatibility -(function exportLocalVariable(ref) { - if (ref.constructor.name === 'Module') { - // node - module.exports = friendRequestStatusEnum; - } else { - // browser - // friendRequestStatusEnum should be already set - } -})(typeof module === 'undefined' ? this : module); diff --git a/js/modules/loki_rss_api.js b/js/modules/loki_rss_api.js index 4a02c04af..a6f446dbe 100644 --- a/js/modules/loki_rss_api.js +++ b/js/modules/loki_rss_api.js @@ -1,39 +1,14 @@ /* eslint-disable no-await-in-loop */ /* eslint-disable no-loop-func */ -/* global log, window, textsecure, ConversationController */ +/* global log, window, textsecure */ const EventEmitter = require('events'); const nodeFetch = require('node-fetch'); -const friendRequestStatusEnum = require('./loki_friend_request_status'); - const PER_MIN = 60 * 1000; const PER_HR = 60 * PER_MIN; const RSS_POLL_EVERY = 1 * PER_HR; // once an hour -/* -const dnsUtil = require('dns'); -// how do we get our local version? -// how do we integrate with extensions.expired() -const VERSION_HOST = 'lastreleasedate.messenger.loki.network'; - -function getLastRelease(cb) { - // doesn't look to have a promise interface - dnsUtil.resolveTxt(VERSION_HOST, function handleResponse(err, records) { - if (err) { - console.error('getLastRelease error', err); - cb(); - return; - } - if (records.length) { - cb(); - } - // return first record... - cb(records[0]); - }); -} -*/ - function xml2json(xml) { try { let obj = {}; diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 8530d190b..a65955bed 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -77,7 +77,10 @@ MessageReceiver.prototype.extend({ }); this.httpPollingResource.pollServer(); localLokiServer.on('message', this.handleP2pMessage.bind(this)); - lokiPublicChatAPI.on('publicMessage', this.handleUnencryptedMessage.bind(this)); + lokiPublicChatAPI.on( + 'publicMessage', + this.handleUnencryptedMessage.bind(this) + ); // set up pollers for any RSS feeds feeds.forEach(feed => { feed.on('rssMessage', this.handleUnencryptedMessage.bind(this));