html bubbles, more simplifications, new session protocol
This commit is contained in:
parent
0c6a58ea24
commit
d3f99d6133
21 changed files with 340 additions and 169 deletions
28
src/io.js
28
src/io.js
|
|
@ -1,7 +1,7 @@
|
|||
const WebSocket = require("ws");
|
||||
const { ipcMain } = require("electron");
|
||||
|
||||
const config = require("./config");
|
||||
const { ipcMain } = require("electron");
|
||||
const { updateTray } = require("./tray");
|
||||
const { backgroundMitt, ipcEmit } = require("./utils/emitter");
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ function connectToPlatform(account)
|
|||
|
||||
.on("error", () => {}) /** keep silent on error */
|
||||
|
||||
.on("message", (payload) => backgroundMitt.emit("ws-message", JSON.parse(payload)))
|
||||
.on("message", (payload) => backgroundMitt.emit("message", JSON.parse(payload)))
|
||||
|
||||
.on("close", (code, reason) => {
|
||||
setConnectionStatus(1);
|
||||
|
|
@ -55,4 +55,26 @@ ipcMain.on("message", (_e, message) => sendMessage(message));
|
|||
|
||||
exports.connectToPlatform = connectToPlatform;
|
||||
exports.sendMessage = sendMessage;
|
||||
exports.disconnectFromPlatform = disconnectFromPlatform;
|
||||
exports.disconnectFromPlatform = disconnectFromPlatform;
|
||||
|
||||
|
||||
|
||||
/* ------------- Test Messages------------- */
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
// sendMessage({
|
||||
// category: "text/plain",
|
||||
// text: "show contacts",
|
||||
// blob: null
|
||||
// })
|
||||
|
||||
sendMessage({
|
||||
category: "text/plain",
|
||||
text: "add contact John Smith, [email protected]",
|
||||
blob: null
|
||||
})
|
||||
|
||||
}, 2000);
|
||||
|
|
|
|||
Loading…
Reference in a new issue