replace publicSendData with LokiPublicChannelAPI instance

pull/455/head
Ryan Tharp 6 years ago
parent 3178d67295
commit 133f2a5656

@ -1376,7 +1376,7 @@
const options = this.getSendOptions(); const options = this.getSendOptions();
options.messageType = message.get('type'); options.messageType = message.get('type');
options.isPublic = this.isPublic(); options.isPublic = this.isPublic();
if (this.isPublic()) { if (options.isPublic) {
options.publicSendData = await this.getPublicSendData(); options.publicSendData = await this.getPublicSendData();
} }
@ -2073,17 +2073,11 @@
const serverAPI = lokiPublicChatAPI.findOrCreateServer( const serverAPI = lokiPublicChatAPI.findOrCreateServer(
this.get('server') this.get('server')
); );
// Can be null if fails
const token = await serverAPI.getOrRefreshServerToken();
const channelAPI = serverAPI.findOrCreateChannel( const channelAPI = serverAPI.findOrCreateChannel(
this.get('channelId'), this.get('channelId'),
this.id this.id
); );
const publicEndpoint = channelAPI.getEndpoint(); return channelAPI;
return {
publicEndpoint,
token,
};
}, },
getModStatus() { getModStatus() {
if (!this.isPublic()) { if (!this.isPublic()) {

Loading…
Cancel
Save